mbutrovich commented on code in PR #4305:
URL: https://github.com/apache/datafusion-comet/pull/4305#discussion_r3359173586


##########
spark/src/main/scala/org/apache/comet/serde/CometScalaUDF.scala:
##########
@@ -78,10 +78,20 @@ object CometScalaUDF extends CometExpressionSerde[ScalaUDF] 
{
       return None
     }
 
+    // `RuntimeReplaceable` expressions (e.g. Spark 4's `StructsToJson`) have 
a `doGenCode` that
+    // always throws "Cannot generate code for expression". Catalyst's 
`ReplaceExpressions` rule
+    // normally rewrites them to their `replacement` form before codegen runs. 
Comet's serde
+    // sometimes works with the pre-rewrite form (via shim reconstruction) for 
matching purposes,
+    // so unwrap to the replacement here before binding so the kernel compiles.
+    val target = expr match {

Review Comment:
   Interesting find.



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