You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/06/13 00:53:09 UTC

[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3038: [GOBBLIN-1190] Fallback to full schema if configured shuffle schema is not available

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



##########
File path: gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/orc/OrcUtils.java
##########
@@ -482,4 +483,32 @@ public static WritableComparable createValueRecursively(TypeDescription schema,
   public static WritableComparable createValueRecursively(TypeDescription schema) {
     return createValueRecursively(schema, 1);
   }
+
+  /**
+   * Check recursively if owning schema is eligible to be up-converted to targetSchema:
+   * 1. TargetSchema is a subset of originalSchema.
+   * 2. TargetSchema is larger than originalSchema.
+   */
+  public static boolean eligibleForUpConvert(TypeDescription originalSchema, TypeDescription targetSchema) {
+    if (!targetSchema.getCategory().isPrimitive()) {
+      if (originalSchema.getFieldNames().size() < targetSchema.getFieldNames().size()) {
+        return true;

Review comment:
       Why is targetSchema having more fields than original schema a sufficient condition for up conversion?

##########
File path: gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/orc/OrcUtils.java
##########
@@ -482,4 +483,32 @@ public static WritableComparable createValueRecursively(TypeDescription schema,
   public static WritableComparable createValueRecursively(TypeDescription schema) {
     return createValueRecursively(schema, 1);
   }
+
+  /**
+   * Check recursively if owning schema is eligible to be up-converted to targetSchema:
+   * 1. TargetSchema is a subset of originalSchema.
+   * 2. TargetSchema is larger than originalSchema.
+   */
+  public static boolean eligibleForUpConvert(TypeDescription originalSchema, TypeDescription targetSchema) {
+    if (!targetSchema.getCategory().isPrimitive()) {
+      if (originalSchema.getFieldNames().size() < targetSchema.getFieldNames().size()) {
+        return true;

Review comment:
       Shouldn't we be checking if each field in the target Schema is present in the record schema? 




----------------------------------------------------------------
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