Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions c++/include/orc/Common.hh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ namespace orc {
ORC_JAVA_WRITER = 0,
ORC_CPP_WRITER = 1,
PRESTO_WRITER = 2,
SCRITCHLEY_GO = 3,
TRINO_WRITER = 4,
UNKNOWN_WRITER = INT32_MAX
};

Expand Down
2 changes: 1 addition & 1 deletion c++/src/Reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ namespace orc {
WriterId ReaderImpl::getWriterId() const {
if (footer->has_writer()) {
uint32_t id = footer->writer();
if (id > WriterId::PRESTO_WRITER) {
if (id > WriterId::TRINO_WRITER) {
return WriterId::UNKNOWN_WRITER;
} else {
return static_cast<WriterId>(id);
Expand Down
4 changes: 4 additions & 0 deletions java/core/src/java/org/apache/orc/OrcFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public enum WriterImplementation {
ORC_CPP(1), // ORC C++ writer
PRESTO(2), // Presto writer
SCRITCHLEY_GO(3), // Go writer from https://github.com/scritchley/orc
TRINO(4), // Trino writer
UNKNOWN(Integer.MAX_VALUE);

private final int id;
Expand Down Expand Up @@ -185,6 +186,9 @@ public enum WriterVersion {
// Scritchley Go Writer
SCRITCHLEY_GO_ORIGINAL(WriterImplementation.SCRITCHLEY_GO, 6),

// Trino Writer
TRINO_ORIGINAL(WriterImplementation.TRINO, 6),

// Don't use any magic numbers here except for the below:
FUTURE(WriterImplementation.UNKNOWN, Integer.MAX_VALUE); // a version from a future writer

Expand Down
6 changes: 6 additions & 0 deletions java/core/src/test/org/apache/orc/TestVectorOrcFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -3423,6 +3423,8 @@ public void testWriterVersion() throws Exception {
OrcFile.WriterImplementation.from(1));
assertEquals(OrcFile.WriterImplementation.PRESTO,
OrcFile.WriterImplementation.from(2));
assertEquals(OrcFile.WriterImplementation.TRINO,
OrcFile.WriterImplementation.from(4));
assertEquals(OrcFile.WriterImplementation.UNKNOWN,
OrcFile.WriterImplementation.from(99));

Expand All @@ -3439,6 +3441,8 @@ public void testWriterVersion() throws Exception {
OrcFile.WriterVersion.from(OrcFile.WriterImplementation.ORC_CPP, 6));
assertEquals(OrcFile.WriterVersion.PRESTO_ORIGINAL,
OrcFile.WriterVersion.from(OrcFile.WriterImplementation.PRESTO, 6));
assertEquals(OrcFile.WriterVersion.TRINO_ORIGINAL,
OrcFile.WriterVersion.from(OrcFile.WriterImplementation.TRINO, 6));
assertEquals(OrcFile.WriterVersion.FUTURE,
OrcFile.WriterVersion.from(OrcFile.WriterImplementation.UNKNOWN, 0));

Expand All @@ -3455,6 +3459,8 @@ public void testWriterVersion() throws Exception {
OrcFile.WriterVersion.HIVE_12055));
assertTrue(OrcFile.WriterVersion.HIVE_12055.includes(
OrcFile.WriterVersion.PRESTO_ORIGINAL));
assertTrue(OrcFile.WriterVersion.HIVE_12055.includes(
OrcFile.WriterVersion.TRINO_ORIGINAL));
}

@Test(expected=IllegalArgumentException.class)
Expand Down
4 changes: 4 additions & 0 deletions proto/orc_proto.proto
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ message Footer {
// 1 = ORC C++
// 2 = Presto
// 3 = Scritchley Go from https://github.com/scritchley/orc
// 4 = Trino
optional uint32 writer = 9;

// information about the encryption in this file
Expand Down Expand Up @@ -423,6 +424,9 @@ message PostScript {
// Version of the Scritchley Go writer:
// 6 = original
//
// Version of the Trino writer:
// 6 = original
//
optional uint32 writerVersion = 6;

// the number of bytes in the encrypted stripe statistics
Expand Down
1 change: 1 addition & 0 deletions site/specification/ORCv1.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ message Footer {
// 1 = ORC C++
// 2 = Presto
// 3 = Scritchley Go from https://github.com/scritchley/orc
// 4 = Trino
optional uint32 writer = 9;
// information about the encryption in this file
optional Encryption encryption = 10;
Expand Down
1 change: 1 addition & 0 deletions site/specification/ORCv2.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ message Footer {
// 1 = ORC C++
// 2 = Presto
// 3 = Scritchley Go from https://github.com/scritchley/orc
// 4 = Trino
optional uint32 writer = 9;
// information about the encryption in this file
optional Encryption encryption = 10;
Expand Down