Re: spark.read.format("jdbc")

2016-08-01 Thread kevin
I was fix it by : val jdbcDF = spark.read.format("org.apache.spark.sql.execution.datasources.jdbc.DefaultSource") .options(Map("url" -> s"jdbc:mysql://${mysqlhost}:3306/test", "driver" -> "com.mysql.jdbc.Driver", "dbtable" -> "i_user", "user" -> "root", "password" -> "123456")) .load()

Re: spark.read.format("jdbc")

2016-08-01 Thread Nikolay Zhebet
You should specify classpath for your jdbc connection. As example, if you want connect to Impala, you can try it snippet: import java.util.Properties import org.apache.spark._ import org.apache.spark.sql.SQLContext import java.sql.Connection import java.sql.DriverManager

Re: spark.read.format("jdbc")

2016-08-01 Thread kevin
maybe there is another version spark on the classpath? 2016-08-01 14:30 GMT+08:00 kevin : > hi,all: >I try to load data from jdbc datasource,but I got error with : > java.lang.RuntimeException: Multiple sources found for jdbc >

spark.read.format("jdbc")

2016-08-01 Thread kevin
hi,all: I try to load data from jdbc datasource,but I got error with : java.lang.RuntimeException: Multiple sources found for jdbc (org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider, org.apache.spark.sql.execution.datasources.jdbc.DefaultSource), please specify the fully