Reputation: 79
How to read CSV file formats in Hadoop using Java code in eclipse IDE?
I have very large file in CSV format and i want to access the CSV file in HDFS in order to perform map reduce program. kindly anyone help me in solving the problem.
I want Java code to access the file .
thanks in advance.
Upvotes: 0
Views: 3662
Reputation: 13402
You can pass the file as input to the mapper. The lines of the file will become value to the mapper.
class FileMapper extends Mapper<LongWritable, Text> {
@Override
public void map(LongWritable key, Text value, Context context) {
// process your CSV records here.
}
}
Upvotes: 1