I'm playing with Spark connections to a local mysql instance.
I've got a mysql jdbc jar that i'm passing in:
pyspark --jars /path/to/jar
ANd I create my SQLContext, etc. And I start doing connection stuff, one version throws and error and ones does not.
SQLContext.read.jdbc(url="jdbc:mysql://localhost:3306?user=root", table="spark.words")
This throws a driver not found error.
SQLContext.read.format("jdbc").option("url","jdbc:mysql://localhost:3306?user=root").option("dbtable","spark.words").option("driver", 'com.mysql.jdbc.Driver').load()
This works as expected.
I thought the two were roughly the same and the former was a convenience method of the latter. What's the difference and why does the SQLContext.read.jdbc
version error out?