Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Load data using PIG using JsonLoader

Highlighted

Load data using PIG using JsonLoader

Explorer

i m having the below data:

"event_header":{"version":"1.0","app_id":null,"app_name":null,"event_id=001","event_timestamp":null,"offering_id":null,"server_timestamp":1534219019523,"accept_language":null,"server_ip_address":"10.87.43.239","topic_name":"stream","client_ip_address":"52.11.100.197"},"eventmessage1":"CompanyGUID=\"99f5b\" EventTypeName=\"TrackingEvent\" EventTypeId=\"42\" EventTypeOwner=\"ments\" EventTypeDescription=\"Generic Tracking string event .\" EventCode= \"0\" EventName=\"\" EventDescription=\"\" EventCatagory=\"\" EventOwner=\"\" EventString=\"Feature=IdentitySetup, payments_auth_id=2679, action_type=TokenTypeToUse, action_message=SABI: SignIn: determiod: er=Gedr-ShTok-Fail. Using_method=METHOD_SHARED_TOKENS, Flow_marker=21, Feature_enabled=False\"","appcontext":"tracking","engineuid":"17930","appname":"bd","CLSServerTimeStamp":"1534219019","scenario":"EventUploader","messagetype":"Info","qbver":"US Release R1","message":"Tracking","tid":"7d"}

i tried loading using JsonLoader as below:

A = LOAD 'event.json' USING JsonLoader


('


	header:(version:chararray,app_id:chararray,app_name:chararray,e_id:chararray,e_timestamp:chararray,offg_id:chararray,
		s_timestamp:chararray,acc:chararray,p_address:chararray,topic_name:chararray,
		c_address:chararray),message1:(appcontext:chararray,engineuid:chararray,appname:chararray,
		CLSServerTimeStamp:chararray,scenario:chararray,messagetype:chararray,qbversion:chararray,message:chararray,tid:chararray)
');

after doing dump A;

i am getting a file which is been created in tmp folder with unreadable format as below.

EUȀ8?=??&

3 REPLIES 3
Highlighted

Re: Load data using PIG using JsonLoader

Explorer

@Bala Vignesh N V @aditya singh can i get some help from u ppl pls...

Highlighted

Re: Load data using PIG using JsonLoader

Explorer

@Geoffrey Shelton Okot can i get some help for this

Highlighted

Re: Load data using PIG using JsonLoader

Explorer

Whats the error here. ? can anyone help mw in getting the correct outcome.

Don't have an account?
Coming from Hortonworks? Activate your account here