Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hadoop(Beginner Level Question)

 
Supraja Jayakumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I wrote this piece of hadoop to preprocess files and write the files again to the output directory. I see files by name part-000, 0001 and so on being created but they all are empty. I use NullWritable for key. But set Text for value. I am not sure if its because of that.

The following is my code:

 
Alan Gates
author
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TextInputFormat already splits your input by line and only hands your map function one line at a time. So you don't need the while loop. Also, String.contains() takes a CharSequence, not a regular expression. Unless you are looking for the literal character sequence "[A-Za-z]" you want to use String.matches().
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!