[ 
https://issues.apache.org/jira/browse/SPARK-10318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14717049#comment-14717049
 ] 

Poorvi Lashkary commented on SPARK-10318:
-----------------------------------------

I have done the following:
private static final String C_DRIVER = 
"org.apache.cassandra.cql.jdbc.CassandraDriver";
private static final String Cassandra_USERNAME = "abc";
private static final String C_PWD = "abc123";
private static final String C_CONNECTION_URL = 
"jdbc:cassandra://localhost:9160/MyKeyspace?user=" + Cassandra_USERNAME + 
"&password=" + C_PWD;
Map<String, String> options = new HashMap<String, String>();
        options.put("driver", C_DRIVER);
        options.put("url", C_CONNECTION_URL);
        options.put("dbtable", "test");
        DataFrame jdbcDF = sc.load("jdbc", options);
jdbcDF .registerTempTable("datafrm");
DataFrame d = sc.sql("select * from datafrm");
d.count();

then getting following error:
InvalidRequestException(why:line 1:25 no viable alternative at input '1' 
(SELECT * FROM test WHERE [1]...))

I am not getting why where clause is here. should we must fetch with where 
clause?

> Getting issue in spark connectivity with cassandra
> --------------------------------------------------
>
>                 Key: SPARK-10318
>                 URL: https://issues.apache.org/jira/browse/SPARK-10318
>             Project: Spark
>          Issue Type: Test
>          Components: SQL
>    Affects Versions: 1.4.0
>         Environment: Spark on local mode with centos 6.x
>            Reporter: Poorvi Lashkary
>            Priority: Minor
>
> Use case: I have to craete spark sql dataframe with the table on cassandra 
> with jdbc driver.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to