1

I have to parse x12 file using hadoop mapreduce code. Could some one please suggest me to how to do this? The parsed output should consumable by some other hadoop tool like hive

Thanks, Rocto

user1321939
  • 319
  • 2
  • 6
  • 18
  • 1
    Why do you HAVE to use mapreduce? Are you going to try to boil down the file from segments / elements to key/value? This is really the wrong tool for the job. X12 wasn't really designed for that kind of data format. – Andrew Feb 21 '14 at 15:10

1 Answers1

0

We need more information, but at a high level:

  1. Based on your language get or create an X12 parser. https://code.google.com/p/x12-parser/ http://www.smooks.org/mediawiki/index.php?title=Main_Page

  2. Decide on what your mapreduce job is going to ouput:

    • XML tree for each X12 document
    • a bunch of segments
    • ???
  3. Write a job that gets X12 documents (you didn't say how they are stored, but I assume you have files in HDFS with the X12), and uses your parser to emit whatever you want downstream.

Dave
  • 13,518
  • 7
  • 42
  • 51