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).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---