Hi, Dan, Does the script works for you? Are you asking a simpler way to do that? ...
Does the script works for you? Are you asking a simpler way to do that?
I am trying to remove a column from a string contined within a file. However the string could be any length of size.
The file can contain input such as….
What I am trying to do is remove the first column within the fullstops.
This is what I am currently doing:
LoadData = load ‘ReadData.csv’ using PigStorage(‘,’); — Splits the data using commas
f = foreach LoadData generate $0 as editData;
splt = foreach f generate FLATTEN(STRSPLIT(sub_domain, ‘\\.’));
–What i am trying to do now is put values $1 to end in a ‘variable’
D = FOREACH splt GENERATE $1 .. as name;
–so then i can do a replace on the whole string
B =foreach D generate REPLACE(name, ‘,’, ‘.’);
If anybody can advise any thing please let me know
The forum ‘Pig’ is closed to new topics and replies.
A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.
Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world