linliu-code commented on code in PR #18126:
URL: https://github.com/apache/hudi/pull/18126#discussion_r3067085543
##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/SparkHoodieTableFileIndex.scala:
##########
@@ -253,10 +262,26 @@ class SparkHoodieTableFileIndex(spark: SparkSession,
// the whole table
if (haveProperPartitionValues(partitionPaths.toSeq) &&
partitionSchema.nonEmpty) {
val predicate = partitionPruningPredicates.reduce(expressions.And)
+ val partitionFieldNames = partitionSchema.fieldNames
+ def getPartitionColumnPath(expr: Expression): Option[String] = expr
match {
+ case a: AttributeReference =>
+ Some(a.name.replaceAll("#\\d+$", ""))
+ case GetStructField(child, _, Some(fieldName)) =>
+ getPartitionColumnPath(child).map(_ + "." + fieldName)
+ case _ => None
+ }
val transformedPredicate = predicate.transform {
+ case g @ GetStructField(_, _, Some(_)) =>
+ getPartitionColumnPath(g).flatMap { path =>
Review Comment:
resolved.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]