[
https://issues.apache.org/jira/browse/FLINK-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15994023#comment-15994023
]
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_r114447396
--- 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 --
Could also be implemented without `zipWithIndex`:
```
val input: Seq[Expression] = fieldExprs.map {
case Call(name, args) => {
val function =
table.tableEnv.getFunctionCatalog.lookupFunction(name, args)
if (function.isInstanceOf[UDAGGFunctionCall]) {
function
} else {
Call(name, args)
}
}
case x => x
}
```
> 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)