unix - Extract key value pairs from a tuple in Pig -
i have file data below:
{"password_match_rate":"0.00","password_match_count":0,"password_invalidate_success_count":0,"notes":"dfh"}
in pig script want dump data below:
password_match_rate,0.00
password_match_count,0
password_invalidate_success_count,0
notes,dfh
can provide on this?
this split input. can try this?
a = load 'file' using textloader() (line:chararray); f = foreach generate replace(line,'"','') (line1:chararray); f1 = foreach f generate flatten(tokenize(line1)) (line2:chararray); f2 = foreach f1 generate replace(line2,':',',');
Comments
Post a Comment