Created 07-19-2016 09:28 PM
I've the following code:
Source = LOAD '.../MyTextFiles' using PigStorage(' '); Data = FOREACH Source GENERATE (chararray)$1 AS Detail_ID, (chararray)$2 AS Code_Time, (chararray)$3 AS BreakLine; Transform = FOREACH Data GENERATE $1, ToUnixTime($2,'dd/MM/yyyyHH:mm:ss','GMT'), $3; SPLIT Transform INTO Src31 IF ToDate($2,'yyyy-MM-dd')==ToDate('2013-12-31', 'yyyy-MM-dd'), Src01 IF ToDate($2,'yyyy-MM-dd')==ToDate('2014-01-01', 'yyyy-MM-dd'); STORE Src31 INTO '.../31_06_2016' using PigStorage(' '); STORE Src01 INTO '.../01_07_2016' using PigStorage(' ');
If run the code without the STORE Statement it fives me successfully but If I try to introduce the new data into a new tables it gives me error... anyone knows why?
Many thanks!
Created 07-21-2016 11:48 PM
Hi @Johnny Fugers and @Suyog Nagaokar,
I tried to provide the answer here . Please let me know if you still have issues.
Thanks,
Sujitha
Created 07-19-2016 10:39 PM
Maybe a small sample dataset would help so someone could try to run it as maybe the gotcha is not with the STORE, but the presence of it means all the transformations have to run. If it is a problem prior to the STORE, then the error (whatever it is since we don't have the output of that) should surface just the same if you used DUMP to display the data.
If DUMP (and not STORE) is working, then probably just a permissions issue with the location you are storing. Again, supply a small sample dataset and I'm sure somebody will chew on it for a few minutes to see if they can figure it out.
Created 07-20-2016 08:21 AM
Here's my source code 🙂 Many thanks Lester! src-data.txt
Created 07-20-2016 07:47 AM
src-data.txt Here's my source code 🙂 Many thanks Lester!
Created 07-20-2016 03:58 PM
Can you please share the exact error message ??
Created 07-21-2016 01:12 PM
Hi Suyog, I already found the problem. I can't tranform millseconds into Unix TimeStamp... I'm trying to convert this field...
Created 07-21-2016 06:35 PM
Good to go then, @Johnny Fugers? No further help needed, right?
Created 07-22-2016 09:06 AM
Right Lester 🙂 Thanks!
Created 07-21-2016 11:48 PM
Hi @Johnny Fugers and @Suyog Nagaokar,
I tried to provide the answer here . Please let me know if you still have issues.
Thanks,
Sujitha