You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2020/12/28 21:38:21 UTC

[GitHub] [orc] pgaref opened a new pull request #595: ORC-709: FIX Boolean to StringGroup schema evolution

pgaref opened a new pull request #595:
URL: https://github.com/apache/orc/pull/595


   ### What changes were proposed in this pull request?
   Special ConvertTreeReader for Boolean using StringGroupFromAnyIntegerTreeReader for String/Char/Varchar types for 1.6 branch
   
   ### Why are the changes needed?
   Properly handle Boolean to String/Char/Varchar conversions
   
   
   ### How was this patch tested?
   TestSchemaEvolution.testBooleanToStringEvolution
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] pgaref merged pull request #595: ORC-709: FIX Boolean to StringGroup schema evolution

Posted by GitBox <gi...@apache.org>.
pgaref merged pull request #595:
URL: https://github.com/apache/orc/pull/595


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] dongjoon-hyun commented on a change in pull request #595: ORC-709: FIX Boolean to StringGroup schema evolution

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #595:
URL: https://github.com/apache/orc/pull/595#discussion_r550122243



##########
File path: java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
##########
@@ -1744,12 +1744,65 @@ public void nextVector(ColumnVector previousVector,
     }
   }
 
+  private static TreeReader createBooleanConvertTreeReader(int columnId,
+                                                           TypeDescription fileType,
+                                                           TypeDescription readerType,
+                                                           Context context) throws IOException {
+
+    // CONVERT from BOOLEAN to schema type.
+    //
+    switch (readerType.getCategory()) {
+
+    case BOOLEAN:
+    case BYTE:
+    case SHORT:
+    case INT:
+    case LONG:
+      if (fileType.getCategory() == readerType.getCategory()) {
+        throw new IllegalArgumentException("No conversion of type " +
+            readerType.getCategory() + " to self needed");
+      }
+      return new AnyIntegerFromAnyIntegerTreeReader(columnId, fileType, readerType,
+          context);
+
+    case FLOAT:
+    case DOUBLE:
+      return new DoubleFromAnyIntegerTreeReader(columnId, fileType,
+          context);

Review comment:
       Shall we make this one liner like the master branch?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] pgaref commented on pull request #595: ORC-709: FIX Boolean to StringGroup schema evolution

Posted by GitBox <gi...@apache.org>.
pgaref commented on pull request #595:
URL: https://github.com/apache/orc/pull/595#issuecomment-752412591


   Thanks for the review @dongjoon-hyun ! This is now merged to 1.6 branch


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] pgaref commented on a change in pull request #595: ORC-709: FIX Boolean to StringGroup schema evolution

Posted by GitBox <gi...@apache.org>.
pgaref commented on a change in pull request #595:
URL: https://github.com/apache/orc/pull/595#discussion_r550128527



##########
File path: java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java
##########
@@ -1744,12 +1744,65 @@ public void nextVector(ColumnVector previousVector,
     }
   }
 
+  private static TreeReader createBooleanConvertTreeReader(int columnId,
+                                                           TypeDescription fileType,
+                                                           TypeDescription readerType,
+                                                           Context context) throws IOException {
+
+    // CONVERT from BOOLEAN to schema type.
+    //
+    switch (readerType.getCategory()) {
+
+    case BOOLEAN:
+    case BYTE:
+    case SHORT:
+    case INT:
+    case LONG:
+      if (fileType.getCategory() == readerType.getCategory()) {
+        throw new IllegalArgumentException("No conversion of type " +
+            readerType.getCategory() + " to self needed");
+      }
+      return new AnyIntegerFromAnyIntegerTreeReader(columnId, fileType, readerType,
+          context);
+
+    case FLOAT:
+    case DOUBLE:
+      return new DoubleFromAnyIntegerTreeReader(columnId, fileType,
+          context);

Review comment:
       Yup, fixed now




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org