You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by madhu phatak <ph...@gmail.com> on 2015/04/27 17:42:26 UTC

Spark JDBC data source API issue with mysql

Hi,
 I have been trying out spark data source api with JDBC. The following is
the code to get DataFrame,

 Try(hc.load("org.apache.spark.sql.jdbc",Map("url" -> dbUrl,"dbtable"->s"($
query) ")))


By looking at test cases, I found that query has to be inside brackets,
otherwise it's treated as table name.  But with when used with MySQL, query
inside the ( ) is treated as derived table which is throwing exception. Is
this the right way to pass the queries to jdbc source or am I missing
something?


Regards,
Madhukara Phatak
http://datamantra.io/