andygrove commented on code in PR #6709: URL: https://github.com/apache/datafusion-comet/pull/6709#discussion_r4199010772
########## spark/src/main/scala/org/apache/comet/udf/CometUDF.scala: ########## @@ -28,6 +28,9 @@ import org.apache.arrow.vector.ValueVector * - Vector arguments arrive at the row count of the current batch. * - Scalar (literal-folded) arguments arrive as length-1 vectors and must be read at index 0. * - The returned vector's length must match `numRows`. + * - Inputs belong to native execution and must not be modified. A scalar argument is the same + * vector on every batch of the task, and a vector argument can share its buffers with the + * rest of the plan. Review Comment: Agreed, "the same vector" was wrong. `CometUdfBridge.evaluate` imports every input on each call and closes them in the `finally`, and `literal_arrays` only lives as long as the `JvmScalarUdfExpr`, which the planner builds once per native plan, so "of the task" was also too wide. I took your wording as is in 1a5797fe8. Spotless re-wraps scaladoc to 98 columns, so the line breaks differ from your suggestion. -- 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]
