You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/04/26 23:43:01 UTC

[GitHub] [hudi] alexeykudinkin commented on a diff in pull request #5430: [WIP][Stacked on 5428] Optimize out mandatory columns when no merging is performed

alexeykudinkin commented on code in PR #5430:
URL: https://github.com/apache/hudi/pull/5430#discussion_r859230135


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/MergeOnReadSnapshotRelation.scala:
##########
@@ -144,6 +186,15 @@ class MergeOnReadSnapshotRelation(sqlContext: SQLContext,
       fsView.getLatestMergedFileSlicesBeforeOrOn(relativePath, queryTimestamp).iterator().asScala.toSeq
     }
   }
+
+  protected def pruneSchemaForMergeSkipping(requiredSchema: HoodieTableSchema): HoodieTableSchema = {
+    val mandatoryFieldNames = mandatoryFields.map(fieldName => HoodieAvroUtils.getRootLevelFieldName(fieldName))
+    val prunedStructSchema = StructType(
+      requiredSchema.structTypeSchema.fields.filterNot(f => mandatoryFieldNames.contains(f.name))
+    )

Review Comment:
   Yeah, realized that as well. This has already been addressed.



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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

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