Support Questions
Find answers, ask questions, and share your expertise

Merge external files of Hive ORC table using Orc mergeFile Core API?

I have orc files in external path of Hive ORC table. I want to merge the ORC files in this path to single file using the Orc Core API:

<code>publicstaticList<Path> mergeFiles(Path outputPath,OrcFile.WriterOptions options,List<Path> inputFiles)throwsIOExceptionMerges multiple ORC files that all have the same schema to produce a single ORC file.The merge will reject files that aren't compatible with the merged file so the output list may be shorter than the input list. The stripes are copied as serialized byte buffers. The user metadata are merged and files that disagree on the value associated with a key will be rejected.

For this i need to initialize WriterOptions(Properties tableProperties, Configuration conf) with tableProperties populated with that of the external table from hive. Any help in this is much appreciated?