andygrove commented on code in PR #6709:
URL: https://github.com/apache/datafusion-comet/pull/6709#discussion_r4205151197
##########
spark/src/main/scala/org/apache/comet/serde/CometScalaUDF.scala:
##########
@@ -145,12 +145,17 @@ object CometScalaUDF extends
CometExpressionSerde[ScalaUDF] {
s"(${e.getClass.getSimpleName}: ${e.getMessage})")
return None
}
- val exprArg = exprToProtoInternal(Literal(bytes, BinaryType), inputs,
binding).getOrElse {
- withFallbackReason(
- expr,
- s"$exprName: codegen dispatch: could not serialize closure-serialized
bound " +
- "expression payload")
- return None
+ // Arg 0 is a digest of the bytes. The dispatcher finds each batch's
kernel by it, so it reads
+ // the bytes only to compile on a cache miss instead of copying and
hashing them for every
+ // batch.
+ val exprArgs = Seq(CometScalaUDFCodegen.digest(bytes), bytes).map {
payload =>
Review Comment:
Added
--
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]