Package org.apache.orc
Class OrcFile
java.lang.Object
org.apache.orc.OrcFile
Contains factory methods to read or write ORC files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic classstatic enumCreate a version number for the ORC file format, so that we can add non-forward compatible changes in the future.static interfacestatic interfacestatic enumstatic classOptions for creating ORC file writers.static enumRecords the version of the writer in terms of which bugs have been fixed.static class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OrcFile.WriterVersionThe WriterVersion for this version of the software.static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReadercreateReader(Path path, OrcFile.ReaderOptions options) static WritercreateWriter(Path path, OrcFile.WriterOptions opts) Create an ORC file writer.mergeFiles(Path outputPath, OrcFile.WriterOptions options, List<Path> inputFiles) Merges multiple ORC files that all have the same schema to produce a single ORC file.static OrcFile.ReaderOptionsreaderOptions(Configuration conf) static OrcFile.WriterOptionswriterOptions(Properties tableProperties, Configuration conf) Create a set of write options based on a set of table properties and configuration.static OrcFile.WriterOptionswriterOptions(Configuration conf) Create a set of writer options based on a configuration.
-
Field Details
-
MAGIC
- See Also:
-
CURRENT_WRITER
The WriterVersion for this version of the software.
-
-
Constructor Details
-
OrcFile
protected OrcFile()
-
-
Method Details
-
readerOptions
-
createReader
- Throws:
IOException
-
writerOptions
Create a set of writer options based on a configuration.- Parameters:
conf- the configuration to use for values- Returns:
- A WriterOptions object that can be modified
-
writerOptions
Create a set of write options based on a set of table properties and configuration.- Parameters:
tableProperties- the properties of the tableconf- the configuration of the query- Returns:
- a WriterOptions object that can be modified
-
createWriter
Create an ORC file writer. This is the public interface for creating writers going forward and new options will only be added to this method.- Parameters:
path- filename to write toopts- the options- Returns:
- a new ORC file writer
- Throws:
IOException
-
mergeFiles
public static List<Path> mergeFiles(Path outputPath, OrcFile.WriterOptions options, List<Path> inputFiles) throws IOException Merges 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.- Parameters:
outputPath- the output fileoptions- the options for writing with although the options related to the input files' encodings are overriddeninputFiles- the list of files to merge- Returns:
- the list of files that were successfully merged
- Throws:
IOException
-