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

vgumashta pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/master by this push:
     new 8f1043c  ORC-437: Make acid schema checks case insensitive
8f1043c is described below

commit 8f1043c6f3ec08b71eb813c19f758c28d43ede69
Author: Vaibhav Gumashta <[email protected]>
AuthorDate: Tue Nov 20 13:23:20 2018 -0800

    ORC-437: Make acid schema checks case insensitive
---
 java/core/src/java/org/apache/orc/impl/SchemaEvolution.java | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/java/core/src/java/org/apache/orc/impl/SchemaEvolution.java 
b/java/core/src/java/org/apache/orc/impl/SchemaEvolution.java
index 480f13a..aa7ba9c 100644
--- a/java/core/src/java/org/apache/orc/impl/SchemaEvolution.java
+++ b/java/core/src/java/org/apache/orc/impl/SchemaEvolution.java
@@ -584,9 +584,15 @@ public class SchemaEvolution {
   private static boolean checkAcidSchema(TypeDescription type) {
     if (type.getCategory().equals(TypeDescription.Category.STRUCT)) {
       List<String> rootFields = type.getFieldNames();
-      if (acidEventFieldNames.equals(rootFields)) {
-        return true;
+      if (rootFields.size() != acidEventFieldNames.size()) {
+        return false;
+      }
+      for (int i = 0; i < rootFields.size(); i++) {
+        if (!acidEventFieldNames.get(i).equalsIgnoreCase(rootFields.get(i))) {
+          return false;
+        }
       }
+      return true;
     }
     return false;
   }

Reply via email to