How to use hadoop for text file?

Use Hadoop Pig to load data from text file w/ each record on multiple lines?

  • I have my data file in the following format: U: john T: 2011-03-03 12:12:12 L: san diego, CA U: john T: 2011-03-03 12:12:12 L: san diego, CA What's the best way to read this file w/ Hadoop/pig/whatever for analysis?

  • Answer:

    Is there any way you can control the way the data is being written? Writing an process that moves this to tab separated would help you do this out of the box. Otherwise, writing a custom record reader (in Pig or Java MapReduce) might be your only option. Neither is very hard.

dolan at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.