sv2000 commented on a change in pull request #3060:
URL: https://github.com/apache/incubator-gobblin/pull/3060#discussion_r455421107



##########
File path: 
gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/orc/OrcUtils.java
##########
@@ -491,18 +490,38 @@ public static WritableComparable 
createValueRecursively(TypeDescription schema)
    */
   public static boolean eligibleForUpConvertHelper(TypeDescription 
originalSchema, TypeDescription targetSchema) {
     if (!targetSchema.getCategory().isPrimitive()) {
-      if 
(!originalSchema.getFieldNames().containsAll(targetSchema.getFieldNames())) {
-        return false;
-      }
-      boolean result = true;
+      if (targetSchema.getCategory().equals(TypeDescription.Category.LIST)) {
+        Preconditions
+            .checkArgument(originalSchema.getChildren() != null, "Illegal 
format of ORC schema as:" + targetSchema);
+        return eligibleForUpConvertHelper(originalSchema.getChildren().get(0), 
targetSchema.getChildren().get(0));
+      } else if 
(targetSchema.getCategory().equals(TypeDescription.Category.MAP)) {
+        Preconditions

Review comment:
       Should the error message be: "Illegal format of ORC schema as:" + 
originalSchema?

##########
File path: 
gobblin-compaction/src/test/java/org/apache/gobblin/compaction/mapreduce/orc/OrcUtilsTest.java
##########
@@ -294,6 +294,21 @@ public void testOrcStructProjection() throws Exception {
     Assert.assertEquals(projectColumnStruct, projectedStructExpectedValue);
   }
 
+  @Test
+  public void complextTypeEligibilityCheck() throws Exception {

Review comment:
       minor typo: complextType -> complexType.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to