[
https://issues.apache.org/jira/browse/ORC-202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052285#comment-16052285
]
ASF GitHub Bot commented on ORC-202:
------------------------------------
Github user omalley commented on a diff in the pull request:
https://github.com/apache/orc/pull/132#discussion_r122513112
--- Diff: java/core/src/java/org/apache/orc/OrcFile.java ---
@@ -108,66 +108,118 @@ public int getMinor() {
}
}
+ public enum WriterImplementation {
+ ORC_JAVA(0), // ORC Java writer
+ ORC_CPP(1), // ORC C++ writer
+ PRESTO(2), // Presto writer
+ UNKNOWN(Integer.MAX_VALUE);
+
+ private final int id;
+
+ WriterImplementation(int id) {
+ this.id = id;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public static WriterImplementation from(int id) {
+ for(WriterImplementation v: values()) {
+ if (v.id == id) {
+ return v;
+ }
+ }
+ return UNKNOWN;
+ }
+ }
+
/**
* Records the version of the writer in terms of which bugs have been
fixed.
* For bugs in the writer, but the old readers already read the new data
* correctly, bump this version instead of the Version.
+ *
+ * The ids are assigned sequentially from 0 per a WriterImplementation.
*/
public enum WriterVersion {
- ORIGINAL(0),
- HIVE_8732(1), // corrupted stripe/file maximum column statistics
- HIVE_4243(2), // use real column names from Hive tables
- HIVE_12055(3), // vectorized writer
- HIVE_13083(4), // decimal writer updating present stream wrongly
- ORC_101(5), // bloom filters use utf8
- ORC_135(6), // timestamp stats use utc
+ // Java ORC Writer
+ ORIGINAL(WriterImplementation.ORC_JAVA, 0),
+ HIVE_8732(WriterImplementation.ORC_JAVA, 1), // corrupted stripe/file
maximum column statistics
+ HIVE_4243(WriterImplementation.ORC_JAVA, 2), // use real column names
from Hive tables
+ HIVE_12055(WriterImplementation.ORC_JAVA, 3), // vectorized writer
+ HIVE_13083(WriterImplementation.ORC_JAVA, 4), // decimal writer
updating present stream wrongly
+ ORC_101(WriterImplementation.ORC_JAVA, 5), // bloom filters use utf8
+ ORC_135(WriterImplementation.ORC_JAVA, 6), // timestamp stats use utc
--- End diff --
Sure.
> Add enum that encodes which writer wrote a file
> -----------------------------------------------
>
> Key: ORC-202
> URL: https://issues.apache.org/jira/browse/ORC-202
> Project: ORC
> Issue Type: Bug
> Reporter: Owen O'Malley
> Assignee: Owen O'Malley
>
> Add a protobuf enum value in the footer that can encode which writer wrote
> the file:
> * ORC Java Writer
> * ORC C++ Writer
> * Presto Writer
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)