Skip to content

Commit ab5ee59

Browse files
author
Adi
committed
add comments and rename file
1 parent 13cb068 commit ab5ee59

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@
106106
"from pyspark.sql import SparkSession\n",
107107
"\n",
108108
"# METHOD I:\n",
109-
"# Update Spark configurations of the following two extraClassPath prior to initiating a Spark session:\n",
109+
"# Update Spark configurations of the following two extraClassPath with the JDBC driver location\n",
110+
"# prior to initiating a Spark session:\n",
110111
"# spark.driver.extraClassPath\n",
111112
"# spark.executor.extraClassPath\n",
112113
"#\n",
@@ -122,12 +123,16 @@
122123
"\n",
123124
"\"\"\"\n",
124125
"# METHOD II:\n",
125-
"# Use \"PYSPARK_SUBMIT_ARGS\" with \"--packages\" option.\n",
126+
"# Use \"PYSPARK_SUBMIT_ARGS\" with \"--packages\" option. (The preferred way)\n",
126127
"# \n",
128+
"# Usage:\n",
129+
"# os.environ[\"PYSPARK_SUBMIT_ARGS\"] = \"--packages dialect:dialect-specific-jdbc-connector:version# pyspark-shell\"\n",
130+
"#\n",
127131
"# NOTE:\n",
128132
"# If you don't connnect to mysql, replace the mysql's connector by the other database's JDBC connector \n",
129133
"# in the following line.\n",
130134
"\"\"\"\n",
135+
"# Set PYSPARK_SUBMIT_ARGS\n",
131136
"#os.environ[\"PYSPARK_SUBMIT_ARGS\"] = \"--packages mysql:mysql-connector-java:5.1.39 pyspark-shell\"\n",
132137
"\n",
133138
"\"\"\"\n",
@@ -137,8 +142,7 @@
137142
"# spark.executor.extraClassPath\n",
138143
"\"\"\" \n",
139144
"# Initiate a Spark Session\n",
140-
"#spark = SparkSession.builder.\\\n",
141-
"# appName(\"Spark JDBC to Databases - ipynb\").getOrCreate()"
145+
"#spark = SparkSession.builder.appName(\"Spark JDBC to Databases - ipynb\").getOrCreate()"
142146
]
143147
},
144148
{

0 commit comments

Comments
 (0)