hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Towne <Robert.To...@WebTrends.com>
Subject Possible to create ORC file with specific name in reducer?
Date Tue, 28 Oct 2014 22:35:15 GMT
I want to write to a new ORC file from a map/reduce job outside of Hive.

I’d like to setup a job without using the format like this:
job.setOutputFormatClass(OrcNewOutputFormat.class);

But instead specify:
job.setOutputFormatClass(NullOutputFormat.class);

And in the reducer, specify the filename, iterate through the results, and close the file
at the end.



Something akin to:

    @Override
    public void reduce(final Text key, final Iterable<MyClass> myClasses, final Context
context)  {
RecordWriter orcWriter = new OrcNewOutputFormat().getRecordWriter(context);
for (MyClass myClass : myClasses) {
orcWriter = new OrcNewOutputFormat().getRecordWriter(context);
}
orcWriter.close(context);

But there is no public constructor for OrcNewOutputFormat to specify the filename I’d like.

Am I missing something, or does anyone know how to specify the filename?

Thank you,
Robert Towne

Mime
View raw message