[
https://issues.apache.org/jira/browse/FLINK-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994028#comment-15994028
]
ASF GitHub Bot commented on FLINK-5906:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/flink/pull/3809#discussion_r114446564
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/table.scala
---
@@ -911,7 +911,21 @@ class GroupedTable(
*/
def select(fields: String): Table = {
val fieldExprs = ExpressionParser.parseExpressionList(fields)
- select(fieldExprs: _*)
+
+ //get the correct expression for UDAGGFunctionCall
+ val input: Seq[Expression] = fieldExprs.zipWithIndex.map {
+ case (Call(name, args), idx) => {
--- End diff --
This does not catch all cases. The agg function call could be nested in one
or more expressions:
```
select('x, weightAvgFun('long, 'int) * 2)
```
So we need to recursively search each expression for UDAGG calls.
It would also be good to make this a utility function in
`ProjectionTranslator`.
I think this needs to be added to `Table.select()` as well (non-grouped,
non-windowed aggregation).
> Add support to register UDAGG in Table and SQL API
> --------------------------------------------------
>
> Key: FLINK-5906
> URL: https://issues.apache.org/jira/browse/FLINK-5906
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
> Reporter: Fabian Hueske
> Assignee: Shaoxuan Wang
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)