cloud-fan commented on code in PR #39949:
URL: https://github.com/apache/spark/pull/39949#discussion_r1129375326
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala:
##########
@@ -194,47 +183,52 @@ private[hive] case class HiveGenericUDF(
override protected def withNewChildrenInternal(newChildren:
IndexedSeq[Expression]): Expression =
copy(children = newChildren)
- override protected def doGenCode(ctx: CodegenContext, ev: ExprCode):
ExprCode = {
- val refTerm = ctx.addReferenceObj("this", this)
- val childrenEvals = children.map(_.genCode(ctx))
-
- val setDeferredObjects = childrenEvals.zipWithIndex.map {
Review Comment:
codegen is performance critical. Previously, we generate code to directly
set values for `deferredObjects`, but in this PR we always create a `Object[]`
to wrap the arguments, which can be bad for performance.
This is a signal that `Invoke` doesn't work very well for Hive UDF. It's
still valuable to have something like `HiveGenericUDFInvokeAdapter` to share
code between interpreted code path and codegen code path.
--
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]