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
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
static class
static enum
Create a version number for the ORC file format, so that we can add non-forward compatible changes in the future.static interface
static interface
static enum
static class
Options for creating ORC file writers.static enum
Records the version of the writer in terms of which bugs have been fixed.static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final OrcFile.WriterVersion
The WriterVersion for this version of the software.static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reader
createReader
(Path path, OrcFile.ReaderOptions options) static Writer
createWriter
(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.ReaderOptions
readerOptions
(Configuration conf) static OrcFile.WriterOptions
writerOptions
(Properties tableProperties, Configuration conf) Create a set of write options based on a set of table properties and configuration.static OrcFile.WriterOptions
writerOptions
(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
-