Pankaj Andhale 2012-10-17, 18:19
I have not used DBStorage myself and the comments are lacking, but there is
a syntactical issue here. All store statements have to be in the following
store relation into 'location' using storefunc(args);
So you're case needs to be
STORE data INTO 'location' using DBStorage ('com.mysql.jdbc.Driver',
127.0.0.1/AnalyticsDB','Insert into test
(created_at,host_name,auth_id) values (?,?,?)');
I'm not really sure what the significance of the "location" variable is in
this case (you can check the DBStorage code and try and glean it, or
someone else can werigh in), but that is what is going on
2012/10/17 Pankaj Andhale <[EMAIL PROTECTED]>
> I am a new user to pig latin and this is the first time I am sending an
> email to the mailing group. excuse me if I have made a mistake.
> I have a pig latin script that cleans the raw log file and then I want to
> store the cleanlog file(data) into a mySql data base
> Following is the command
> STORE data INTO DBStorage ('com.mysql.jdbc.Driver', 'dbc:mysql://
> 127.0.0.1/AnalyticsDB','Insert into test
> (created_at,host_name,auth_id)values (?,?,?)');
> But I am getting an error
> 2012-10-17 11:04:40,177 [main] ERROR org.apache.pig.tools.grunt.Grunt -
> ERROR 1200: <line 23, column 14> mismatched input 'DBStorage' expecting
> I tired to read the stack trace generated inthe log file but wasn't able to
> figure out
> I have searched for this error but couldn't find the answer.
> I came across the sqoop tool to load data in and out of HDFS but I want to
> keep it simple using DBStorage at this point.
> I am using pig 0.10
> and mySQL 5.5.24
> I would really appreciate if anyone could help me resolve this problem.