Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Convert bytearray/chararray to MAP


Copy link to this message
-
Convert bytearray/chararray to MAP
Hi,

I have data in the MAP format but stored as a chararray. If I want to use
it as MAP how can I cast chararray to MAP.

Data example:
{(13630398,38039eee-044f-4226-ad9c-037adb3efc2e_0,flat,video,false,queue,-1001,,,,,0,{(70101375,70101375,),(70099787,70099787,),(70077782,70077782,)}),(13462100,38039eee-044f-4226-ad9c-037adb3efc2e_1,flat,video,false,recentlyWatched,-1001,,,,,1,{(70217913,70217913,),(70155592,70155592,),(70261364,70261364,),(70140438,70140438,),(70099128,70099128,),(70227645,70227645,),(70243574,70243574,),(70143836,70143836,),(70243450,70243450,),(70128764,70128764,),(70159319,70159319,),(70228173,70228173,),(70210431,70210431,),(70219484,70219484,),(70095309,70095309,),(70099118,70099118,),(70180057,70180057,),(70228194,70228194,),(70099787,70099787,),(70242800,70242800,),(70138810,70138810,),(70120143,70120143,),(70109681,70109681,),(70227946,70227946,),(70155582,70155582,),(70135899,70135899,),(70213466,70213466,),(70140358,70140358,),(70122302,70122302,),(70209160,70209160,)})}
This is stored as a chararray, and in my script I want to cast it as:
{rows: (track_id:int,sub_root_uuid:chararray,list_type:chararray,
item_type:chararray, hasevidence:chararray,listContext:chararray,
genre_id:int,taste_evidence:chararray,rated_evidence:
chararray,watched_evidence:chararray,queued_evidence:chararray,presentation_row_number:
int, mmid: {t:(show_title_id:int, id:int,
queue_title_evidence: chararray)})}

How I can do it in pig?

Thanks,
Sonia