raj b
raj b

Reputation: 11

Error in loading the csv file in Apache Pig

I tried to load the data using following command in apache pig on hdfs mode: test = LOAD /user/swap/done2.csv using PigStorage (',')as (ID:long, Country:chararray, Carrier:float, ClickDate:chararray, Device:chararray, OS:chararray, UserIp:chararray, PublisherId:float, advertiserCampaignId:float, Fraud:float);

it gives the error as below: 2017-12-12 13:49:10,347 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: mismatched input '/' expecting QUOTEDSTRING Details at logfile: /home/matlab/Documents/pig_1513066708530.log

surprisingly My dataset does not have the 13 columns. my dataset is as shown in picture

Upvotes: 0

Views: 217

Answers (1)

Nandish B
Nandish B

Reputation: 212

file path should be in quotes '' to LOAD

test = LOAD '/user/swap/done2.csv' using PigStorage (',')as (ID:long, Country:chararray, Carrier:float, ClickDate:chararray, Device:chararray, OS:chararray, UserIp:chararray, PublisherId:float, advertiserCampaignId:float, Fraud:float);

Upvotes: 0

Related Questions