Skip to content

Commit

Permalink
Update SetMaster, fix caching issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rishic3 committed Oct 8, 2024
1 parent 1d21c16 commit 56de5f3
Show file tree
Hide file tree
Showing 11 changed files with 1,154 additions and 1,113 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@
"conda_env = os.environ.get(\"CONDA_PREFIX\")\n",
"\n",
"conf = SparkConf()\n",
"if 'spark' not in globals():\n",
" # If Spark is not already started with Jupyter, attach to Spark Standalone\n",
" import socket\n",
" hostname = socket.gethostname()\n",
" conf.setMaster(f\"spark://{hostname}:7077\") # assuming Master is on default port 7077\n",
"conf.set(\"spark.task.maxFailures\", \"1\")\n",
"conf.set(\"spark.driver.memory\", \"8g\")\n",
"conf.set(\"spark.executor.memory\", \"8g\")\n",
Expand Down Expand Up @@ -282,7 +287,7 @@
"\n",
"len(lines)\n",
"\n",
"df = spark.createDataFrame(lines, ['lines']).repartition(10).cache()"
"df = spark.createDataFrame(lines, ['lines']).repartition(8).cache()"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@
"conda_env = os.environ.get(\"CONDA_PREFIX\")\n",
"\n",
"conf = SparkConf()\n",
"if 'spark' not in globals():\n",
" # If Spark is not already started with Jupyter, attach to Spark Standalone\n",
" import socket\n",
" hostname = socket.gethostname()\n",
" conf.setMaster(f\"spark://{hostname}:7077\") # assuming Master is on default port 7077\n",
"conf.set(\"spark.task.maxFailures\", \"1\")\n",
"conf.set(\"spark.driver.memory\", \"8g\")\n",
"conf.set(\"spark.executor.memory\", \"8g\")\n",
Expand Down Expand Up @@ -214,7 +219,7 @@
"\n",
"len(lines)\n",
"\n",
"df = spark.createDataFrame(lines, ['lines']).repartition(10).cache()"
"df = spark.createDataFrame(lines, ['lines']).repartition(8).cache()"
]
},
{
Expand Down
Loading

0 comments on commit 56de5f3

Please sign in to comment.