Support Questions
Find answers, ask questions, and share your expertise

APACHE PIG Issue - Split based on Data_Transformation

src-data.txt

I've the following code:

Data = LOAD '.../teste1.txt' using PigStorage('');

Fields = FOREACH Data GENERATE (chararray)$0 AS ID, (chararray)$1 AS Time, (chararray)$2 AS Code, (chararray)$3 AS B_In_Activity, (chararray)$4 AS B_Out_Activity, (chararray)$5 AS In_Activity, (chararray)$6 AS Out_Activity, (chararray)$7 AS Activity);

Transf = FOREACH Data_Fields GENERATE ID, ToUnixTime(Time,'dd/MM/yyyyHH:mm:ss', 'GMT') AS Time, Code, B_Activity, B_Activity, In_Activity, Out_Activity, Activity;

SPLIT Transf INTO Src31 IF ToDate(Time) == ToDate('2014-12-31', 'yyyy-mm-dd');

STORE Src31 INTO '.../TESTE2' using PigStorage('');

I want the following activities: 1) Transform the field Time into a Unix TimeStamo 2) Split the datasets based on date

When execute my code it gives me an error...

I've upload my source data to show my data.

Anyone can help me? Many thanks!!!!

1 REPLY 1

Re: APACHE PIG Issue - Split based on Data_Transformation