[ 
https://issues.apache.org/jira/browse/ORC-437?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16693790#comment-16693790
 ] 

ASF GitHub Bot commented on ORC-437:
------------------------------------

vaibhavgumashta closed pull request #339: ORC-437: Make acid schema checks case 
insensitive
URL: https://github.com/apache/orc/pull/339
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 480f13ab25..5218e721de 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,12 @@ void buildIdentityConversion(TypeDescription readerType) {
   private static boolean checkAcidSchema(TypeDescription type) {
     if (type.getCategory().equals(TypeDescription.Category.STRUCT)) {
       List<String> rootFields = type.getFieldNames();
-      if (acidEventFieldNames.equals(rootFields)) {
-        return true;
+      for (int i = 0; i < acidEventFieldNames.size(); i++) {
+        if (!acidEventFieldNames.get(i).equalsIgnoreCase(rootFields.get(i))) {
+          return false;
+        }
       }
+      return true;
     }
     return false;
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Make acid schema checks case insensitive
> ----------------------------------------
>
>                 Key: ORC-437
>                 URL: https://issues.apache.org/jira/browse/ORC-437
>             Project: ORC
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 1.5.3
>            Reporter: Vaibhav Gumashta
>            Assignee: Vaibhav Gumashta
>            Priority: Major
>         Attachments: ORC-437.1.patch
>
>
> When reading from an Orc file, SchemaEvolution evolution tries to determine 
> if this is an Acid compliant format by comparing field names with Acid event 
> names in {{SchemaEvolution.checkAcidSchema}}. Would be good to make this 
> comparison case insensitive.
> This requirement comes in from HIVE-20699 where a Hive query is being used to 
> run compaction (and hence write the compacted data to the bucket files via a 
> HiveQL query). Since hive converts all column names to lower case, the 
> compacted files end up with lower case Acid schema columns. The change is 
> much simpler when made in Orc.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to