Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

how to remove '()' from pig output(bag Format)

Expert Contributor


i want to store pig output in hive table. i have written pig job in .net sdk.

Pig output:




but i want to store the output in following format:





Hi @heta desai

I believe the outer braces doesnt represent bag. Normally in pig whenever you DUMP the output it will be displayed within "()".

Once you store the pig output in a file it wont show braces.

In case if you have any bag in a pig output then using FLATTEN to remove the bag and store it in a hive table.


Agreed. () are only when using DUMP to look at the data (and its structure). To prove this you can use PigStorage to HDFS and when you read the file you will not see the () .

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.