0

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.

2 Answers 2

1

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.
    }
}
Sign up to request clarification or add additional context in comments.

Comments

0

Create you own CSVInputFormat CSVInputFormat

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.