Skip to content

Commit

Permalink
allows init spark in cluster mode
Browse files Browse the repository at this point in the history
  • Loading branch information
enriquea committed May 14, 2024
1 parent e7dfb84 commit 16002e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fsspark/config/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
PYARROW_SETTINGS,
PANDAS_ON_SPARK_API_SETTINGS)


os.environ['PYARROW_IGNORE_TIMEZONE'] = "1"


# os.environ['JAVA_HOME'] = "/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home"
# os.environ['SPARK_HOME'] = "/usr/local/spark-3.3.0-bin-hadoop3"

def init_spark(apply_pyarrow_settings: bool = True,
def init_spark(master: str = "local[8]",
apply_pyarrow_settings: bool = True,
apply_extra_spark_settings: bool = True,
apply_pandas_settings: bool = True) -> SparkSession:
"""
Expand All @@ -24,7 +26,7 @@ def init_spark(apply_pyarrow_settings: bool = True,

# init or get spark session.
spark = (SparkSession.builder
.master("local[8]")
.master(master)
.appName("fs-spark")
)

Expand Down

0 comments on commit 16002e7

Please sign in to comment.