cloud-fan commented on code in PR #39949:
URL: https://github.com/apache/spark/pull/39949#discussion_r1130947376
##########
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:
I think we should refactor `HiveGenericUDF` first, then follow it to
implement codegen of `HiveSimpleUDF`.
What the refactor should do is to add something like
`HiveGenericUDFInvokeAdapter` in this PR, to keep all the states. Then
`HiveGenericUDF` just manipulates this stateful object in both interpreted code
path and codegen.
--
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]