hba
hba

Reputation: 7790

Why do Hive & HiveServer2 Require mapred.InputFormat?

I just want to make sure I'm not missing something. I'm working on an InputFormat for Hive to deal with our specific hdfs-file-format. I just realized that it needs to extend mapred.InputFormat instead of the mapreduce.InputFormat

Is this right? Or am I missing something? Can I use the FileInputFormat from the mapreduce package?

Upvotes: 0

Views: 91

Answers (1)

Pradeep Gollakota
Pradeep Gollakota

Reputation: 2181

You will have to use mapred.InputFormat Hive has not fully migrated to the new package yet. Should you need/want to use mapreduce.InputFormat package for any reason, you can always wrap the mapreduce.InputFormat. In fact, that's what I did to get it interact with Hive but still leverage the mapreduce package.

EDIT: In order to interoperate between the two types of APIs, I abstracted the logic of reading the file records to another class and use it in both InputFormats.

Upvotes: 1

Related Questions