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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -