apache pig - StrSplit in Pig functions -
Can someone explain to me in getting this output down in Pigscript
my input file is down
a.txt
aaa.kyl, data, data bbb.kkk, data, data cccccc.hj, data, data qa.dff, data, data
I am writing pig script like this
using A = load 'a.txt' PigStorage (',') AS (a1: chararray, a2 : Chararray, a3: chararray); B = format A Generated Flatstone (Strass Limit (A1)), A2, A3;
I do not know how to move forward with it ... I keep it like this. Basically I need all the letters after the dot mark in atom for the first time
< (kyl, data, data) (kkk, data, data) (hj, data, data) ( DFF, Data, Data)
Can someone give me the code for this
What you need to do here -
There is a problem of survival here Pig parsing routine, when it encounters dot, because it is considered as operator, then A. See this link for more information.
You can use the Unicode Escape sequence instead for the dot: \ u002E However it should also avoid slash and put in single quoted string.
The code below will work for you and you can fix it according to your convenience -
A = load 'A.TXTT' will be used in pygraphoges (' , ') AS (A1: Chararay, A2: Chararai, A3: Chararay); B = format as a Generated Flaton (Strass Limit (A1, '\\ u002E')) (A1: Charray, A1F1: Chararay), A2, A3; C = FOREACH B1A1F1, A2, A3;
Hope it helps.
Comments
Post a Comment