cloud-fan commented on code in PR #48509:
URL: https://github.com/apache/spark/pull/48509#discussion_r1859687536


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/optimizer/OptimizeJsonExprsSuite.scala:
##########
@@ -292,7 +292,7 @@ class OptimizeJsonExprsSuite extends PlanTest with 
ExpressionEvalHelper {
 
     Seq("""{"a":1, "b":2, "c": 123, "d": "test"}""", null).foreach(v => {
       val row = create_row(v)
-      checkEvaluation(e1, e2.eval(row), row)
+      checkEvaluation(e1, replace(e2).eval(row), row)

Review Comment:
   The problem is, it's not only about matching, but also about replacing. In 
`OptimizeCsvJsonExprs`, we need to replace the `JsonToStructs` with a new one 
using a different schema, and it's very hard to do so with matching `Invoke`.
   
   In the long term, I think we should make `RuntimeReplaceable` really do 
replacement at runtime, instead of at the beginning of the optimizer, 
especially for the one with `StaticInvoke`/`Invoke`.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to