Reputation: 23
I'm beginning learn PIG and I want to split a tuple in character '\'. My original tuple is
(192.168.2.227\al0000)
and I need to split it in '\'
(192.168.2.227, al0000)
I tryed to use
B = FOREACH original GENERATE FLATTEN (STRSPLIT(tuple, '\\u034B'));
but it dont work. What is the proper solution ?
Upvotes: 1
Views: 574
Reputation: 2287
Input :
192.168.2.227\al0000
Pig Script :
A = LOAD 'input.csv' as line;
B = FOREACH A GENERATE FLATTEN (STRSPLIT(line, '([\\\\])'));
dump B;
Second argument used is a regex to identify '\'
Output :
(192.168.2.227,al0000)
Ref :
Upvotes: 2
Reputation: 1280
Did you try '\\\\'
in place of the strange unicode code point u034B?
Upvotes: 0