orc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject orc git commit: ORC-229. Add an UNSTABLE-PRE-2.0 file format version.
Date Mon, 14 Aug 2017 16:40:52 GMT
Repository: orc
Updated Branches:
  refs/heads/master cbb12a974 -> 3ea22f317


ORC-229. Add an UNSTABLE-PRE-2.0 file format version.

Fixes #153

Signed-off-by: Owen O'Malley <omalley@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/orc/repo
Commit: http://git-wip-us.apache.org/repos/asf/orc/commit/3ea22f31
Tree: http://git-wip-us.apache.org/repos/asf/orc/tree/3ea22f31
Diff: http://git-wip-us.apache.org/repos/asf/orc/diff/3ea22f31

Branch: refs/heads/master
Commit: 3ea22f3173a2df19196aaa4265248cb99fd11f8e
Parents: cbb12a9
Author: Owen O'Malley <omalley@apache.org>
Authored: Fri Aug 11 13:23:22 2017 -0700
Committer: Owen O'Malley <omalley@apache.org>
Committed: Mon Aug 14 09:40:28 2017 -0700

----------------------------------------------------------------------
 java/core/src/java/org/apache/orc/OrcFile.java        | 14 ++++++++++++++
 .../core/src/java/org/apache/orc/impl/WriterImpl.java |  7 +++++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/orc/blob/3ea22f31/java/core/src/java/org/apache/orc/OrcFile.java
----------------------------------------------------------------------
diff --git a/java/core/src/java/org/apache/orc/OrcFile.java b/java/core/src/java/org/apache/orc/OrcFile.java
index d1fa3fb..99f22dd 100644
--- a/java/core/src/java/org/apache/orc/OrcFile.java
+++ b/java/core/src/java/org/apache/orc/OrcFile.java
@@ -62,6 +62,20 @@ public class OrcFile {
   public enum Version {
     V_0_11("0.11", 0, 11),
     V_0_12("0.12", 0, 12),
+
+    /**
+     * Do not use this format except for testing. It will not be compatible
+     * with other versions of the software. While we iterate on the ORC 2.0
+     * format, we will make incompatible format changes under this version
+     * without providing any forward or backward compatibility.
+     *
+     * When 2.0 is released, this version identifier will be completely removed.
+     */
+    UNSTABLE_PRE_2_0("UNSTABLE-PRE-2.0", 1, 9999),
+
+    /**
+     * The generic identifier for all unknown versions.
+     */
     FUTURE("future", Integer.MAX_VALUE, Integer.MAX_VALUE);
 
     public static final Version CURRENT = V_0_12;

http://git-wip-us.apache.org/repos/asf/orc/blob/3ea22f31/java/core/src/java/org/apache/orc/impl/WriterImpl.java
----------------------------------------------------------------------
diff --git a/java/core/src/java/org/apache/orc/impl/WriterImpl.java b/java/core/src/java/org/apache/orc/impl/WriterImpl.java
index 90eaf4f..d839620 100644
--- a/java/core/src/java/org/apache/orc/impl/WriterImpl.java
+++ b/java/core/src/java/org/apache/orc/impl/WriterImpl.java
@@ -149,6 +149,13 @@ public class WriterImpl implements Writer, MemoryManager.Callback {
       this.bufferSize = getEstimatedBufferSize(adjustedStripeSize,
           numColumns, opts.getBufferSize());
     }
+    if (version == OrcFile.Version.FUTURE) {
+      throw new IllegalArgumentException("Can not write in a unknown version.");
+    } else if (version == OrcFile.Version.UNSTABLE_PRE_2_0) {
+      LOG.warn("ORC files written in " + version.getName() + " will not be" +
+          " readable by other versions of the software. It is only for" +
+          " developer testing.");
+    }
     if (version == OrcFile.Version.V_0_11) {
       /* do not write bloom filters for ORC v11 */
       this.bloomFilterColumns = new boolean[schema.getMaximumId() + 1];


Mime
View raw message