Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7188427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:04:56+00:00 2026-05-28T19:04:56+00:00

What kind of file formats can be read using PIG? How can I store

  • 0

What kind of file formats can be read using PIG?

How can I store them in different formats? Say we have CSV file and I want to store it as MXL file how this can be done? Whenever we use STORE command it makes directory and it stores file as part-m-00000 how can I change name of the file and overwrite directory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:04:57+00:00Added an answer on May 28, 2026 at 7:04 pm

    what kind of file formats can be read using PIG? how can i store them in different formats?

    There are a few built-in loading and storing methods, but they are limited:

    • BinStorage – “binary” storage
    • PigStorage – loads and stores data that is delimited by something (such as tab or comma)
    • TextLoader – loads data line by line (i.e., delimited by the newline character)

    piggybank is a library of community contributed user-defined functions and it has a number of loading and storing methods, which includes an XML loader, but not a XML storer.


    say we have CSV file n i want to store it as MXL file how this can be done?

    I assume you mean XML here… Storing in XML is something that is a bit rough in Hadoop because it splits files on a reducer basis, so how do you know where to put the root tag? this likely should be some sort of post-processing to produce wellformed XML.

    One thing you can do is to write a UDF that converts your columns into an XML string:

    B = FOREACH A GENERATE customudfs.DataToXML(col1, col2, col3);
    

    For example, say col1, col2, col3 are "foo", 37, "lemons", respectively. Your UDF can output the string "<item><name>Foo</name><num>37</num><fruit>lemons</fruit></item>".


    whenever we use STORE command it makes directory and it stores file as part-m-00000 how can i change name of the file and overwrite directory?

    You can’t change the name of the output file to be something other than part-m-00000. That’s just how Hadoop works. If you want to change the name of it, you should do something to it after the fact with something like hadoop fs -mv output/part-m-00000 newoutput/myoutputfile. This could be done with a bash script that runs the pig script then executes this command.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want my app to catch downloads of a particular kind of file. Here's
I have an XML file of this Kind : <data> <First id=FirstOne> <lines id=Lines>
I have a incomplete csv file that needs to be accurately updated, so there
I want to store confidential data in a digitally signed file, so that I
Say I have some data which I want several kinds of. I think the
I have a project consisting of four programs for different platforms; all of them
Let's say I have a custom file archive format similar to Zip or Rar,
I'm designing some cross platform tool, and I want to store some read only
I'm trying to create a kind of file generator in Php. Basically, it get
Perl is really good for writing the kind of string/file parsing programs that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.