impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Ho (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-1430: enable codegen for native UDAs
Date Wed, 18 Jan 2017 23:14:54 GMT
Michael Ho has posted comments on this change.

Change subject: IMPALA-1430: enable codegen for native UDAs

Patch Set 10:


Looking good. Most comments about comments.
File be/src/exprs/

PS10, Line 539:     // The last (in/out) argument is exposed to UDAs via the FunctionContext
as the
              :     // return type, rather than as the last argument type. Constant inlining
              :     // therefore expose it in the same way.
May help to add a remark in about the assumption that the type of
the last argument (the intermediate value) is treated as return type instead of argument type
from the perspective of Expr::InlineConstants(). Otherwise, this can easily lead to confusion
when writing built-in UDA. I think all use cases of Expr::InlineConstants() for built-in UDAs
now are for substituting the arguments' types.

On the other hand, if we don't consider the last argument as the return value but instead
as a value which will be updated by the UDA, these logic can be hidden inside ScalarFnCall::GetUdf().
Not sure if we are getting much by using the current convention in the patch.
File be/src/exprs/scalar-fn-call.h:

PS10, Line 53: or HDFS
or external module ?

PS10, Line 54:  UDF
It could also be the update/merge function of a UDA, right ? Not sure if it makes sense to
call it a UDF in that case.

PS10, Line 61:  
nit: extra blank space.
File be/src/udf/udf-internal.h:

PS10, Line 51: UDAF
May be less confusing to say "UDA functions"

PS10, Line 52: an Expr node
             : /// generated by the Impala frontend
May be it helps to differentiate the ExprNode in the FE and BE b stating:

"TExprNode generated by the Impala frontend"

PS10, Line 54:  Backend code should not create FunctionContexts for other
             : /// purposes
FunctionContexts should entirely be allocated and managed by ExprContext. Exprs shouldn't
try to create FunctionContext themselves.

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: Id1708eaa96eb76fb9bec5eeabf209f81c88eec2f
Gerrit-PatchSet: 10
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Tim Armstrong <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Michael Ho
Gerrit-Reviewer: Michael Ho <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-HasComments: Yes

View raw message