cann't access cassandra table in pig

31 views
Skip to first unread message

jaikumar

unread,
Sep 12, 2013, 3:59:27 AM9/12/13
to chenn...@googlegroups.com
Hi,

       I want to use  cassandra table in pig script .  for this  i created keyspace and column family
cqlsh:mykeyspace1> select * from users;

 uid | firstname | lastname
---------+-------+-------
    45 |  jay | kumar
    44 |  tamil |selvam
    46 |  john | david
i run the following pig query in grunt
grunt> rows = LOAD 'cassandra://Keyspace1/U' USING CassandraStorage();

and got following error
2013-09-12 13:13:17,090 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1070: Could not resolve CassandraStorage using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]

Anybody help me solve this issue?

Thanks,
Jaikumar Krishna

Senthil Kumar

unread,
Sep 12, 2013, 4:45:51 AM9/12/13
to chenn...@googlegroups.com
Can you try fully Qualified Classname instead of  CassandraStorage alone??

jaikumar

unread,
Sep 13, 2013, 3:36:52 AM9/13/13
to chenn...@googlegroups.com
Senthil.
       
        sorry , I dont know how to give fully Qualified Classname .. i created table in my local keyspace name is keyspace1 and column family is users..

jaikumar

unread,
Sep 13, 2013, 5:28:53 AM9/13/13
to chenn...@googlegroups.com
Senthil,

     I am using apache pig-0.11.1 , apache-cassandra-1.2.9   i created cassandra table using cli , i have pig udf using regex to extract html pages, for that i have a pig script to get input, which are stored in cassandra table.  Previously i have used those inputs (html pages) in text file and put into HDFS . By using  UDF and pigscript i extracted name address info from html pages ..   Now in this same case instead of text input, i want to use cassandra table by using following  reference.
http://frommyworkshop.blogspot.in/2012/07/single-node-hadoop-cassandra-pig-setup.html

Thanks,

Senthil Kumar

unread,
Sep 13, 2013, 6:19:56 AM9/13/13
to chenn...@googlegroups.com
Are you starting the pig grunt from cassnadra-x.x/contrib/pig folder?
If yes, it sets all the jars needed for your pig latin scripts related to cassandra.

Can you have a look at the   apache-cassandra-x.x.x\contrib\pig\bin\pig_cassandra ??

Let me know if you face any issues

jaikumar

unread,
Sep 13, 2013, 7:51:56 AM9/13/13
to chenn...@googlegroups.com
Senthil,

 I am running pig grunt from apache-cassandra-1.2.9  folder but i cant find contrib/pig  folder  and i want to know where \bin\pig_cassandra  located or can i copy from anywhere ..?  . I founf contrib folder only in apache_pig-0.11.1 ...

Thanks,
Reply all
Reply to author
Forward
0 new messages