Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #.option("driver", "com.dbschema.CassandraJdbcDriver")
- df = spark_sql_context.read.format('jdbc')
- .option("driver", "com.dbschema.CassandraJdbcDriver")
- .option("url",url)
- .option("dbtable", query)
- .option("numPartitions", 2)
- .load()
- `
- `java.sql.SQLException: com.datastax.driver.core.exceptions.SyntaxError: line 1:14 no viable alternative at input 'select' (SELECT * FROM [select]...)
- at com.dbschema.CassandraPreparedStatement.executeQuery(CassandraPreparedStatement.java:113)
- at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:62)
- at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:113)
- at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:45)
- at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:330)
- at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:152)
- at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:125)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
- at java.lang.reflect.Method.invoke(Method.java:498)
- at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
- at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
- at py4j.Gateway.invoke(Gateway.java:282)
- at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)`
- spark_sql_context.read.format("org.apache.spark.sql.cassandra").options(table="tablename", keyspace="keyspace name").load()
Add Comment
Please, Sign In to add comment