hudi-agent commented on code in PR #19471:
URL: https://github.com/apache/hudi/pull/19471#discussion_r3715756205


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestBucketIndexSupport.scala:
##########
@@ -379,11 +376,20 @@ class TestBucketIndexSupport extends 
HoodieSparkClientTestBase with PredicateHel
     exprBucketAnswerCheck(bucketIndexSupport, fallBack, List.empty, fallback = 
true)
   }
 
-  def exprBucketAnswerCheck(bucketIndexSupport: BucketIndexSupport, exprRaw: 
String, expectResult: List[Int], fallback: Boolean): Unit = {
+  /**
+   * Resolves an expression and runs it through the optimizer, wrapped in
+   * [[HoodieDummyExpressionHolder]] so that the expression's references are 
exposed as plan output.
+   * Spark 4 validates plans after every optimizer rule (SPARK-44219) and 
rejects a plan whose
+   * aliases are not reachable from its output, which the holder Spark ships 
does not satisfy.
+   */
+  protected def optimizeResolvedExpr(exprRaw: String): Expression = {
     val resolveExpr = HoodieCatalystExpressionUtils.resolveExpr(spark, 
exprRaw, structSchema)

Review Comment:
   🤖 nit: `resolveExpr` reads like a verb (an action to perform) rather than 
the resolved expression it holds — could you rename it to `resolvedExpr` to 
match the convention used for `optimizerExpr` below?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to