You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by om...@apache.org on 2019/10/02 20:42:21 UTC

[orc] branch branch-1.6 updated: ORC-553: Add test case to check that SchemaEvolution checkAcidSchema works well

This is an automated email from the ASF dual-hosted git repository.

omalley pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.6 by this push:
     new bee024a  ORC-553: Add test case to check that SchemaEvolution checkAcidSchema works well
bee024a is described below

commit bee024a7649516c00239966ea134c6c32ab96232
Author: Aron Hamvas <ha...@cloudera.com>
AuthorDate: Thu Sep 12 13:15:38 2019 +0200

    ORC-553: Add test case to check that SchemaEvolution checkAcidSchema works well
    
    Fixes: #429
    
    Signed-off-by: Owen O'Malley <om...@apache.org>
---
 .../test/org/apache/orc/impl/TestSchemaEvolution.java   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/java/core/src/test/org/apache/orc/impl/TestSchemaEvolution.java b/java/core/src/test/org/apache/orc/impl/TestSchemaEvolution.java
index 304ee4b..009bc67 100644
--- a/java/core/src/test/org/apache/orc/impl/TestSchemaEvolution.java
+++ b/java/core/src/test/org/apache/orc/impl/TestSchemaEvolution.java
@@ -2364,4 +2364,21 @@ public class TestSchemaEvolution {
       assertFalse(rows.nextBatch(batchTimeStamp));
     }
   }
+
+  public void testCheckAcidSchema() {
+    String ccSchema = "struct<operation:int,originalTransaction:bigint,bucket:int," +
+        "rowId:bigint,currentTransaction:bigint," +
+        "row:struct<a:int,b:int>>";
+    String lcSchema = "struct<operation:int,originaltransaction:bigint,bucket:int," +
+        "rowid:bigint,currenttransaction:bigint," +
+        "row:struct<a:int,b:int>>";
+
+    TypeDescription typeCamelCaseColumns = TypeDescription.fromString(ccSchema);
+    TypeDescription typeLowerCaseColumns = TypeDescription.fromString(lcSchema);
+    SchemaEvolution evoCc = new SchemaEvolution(typeCamelCaseColumns, null, options);
+    SchemaEvolution evoLc = new SchemaEvolution(typeLowerCaseColumns, null, options);
+
+    assertTrue("Schema (" + ccSchema +") was found to be non-acid ", evoCc.isAcid());
+    assertTrue("Schema (" + lcSchema +") was found to be non-acid ", evoLc.isAcid());
+  }
 }