[
https://issues.apache.org/jira/browse/FLINK-3567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15179818#comment-15179818
]
ASF GitHub Bot commented on FLINK-3567:
---------------------------------------
Github user twalthr commented on a diff in the pull request:
https://github.com/apache/flink/pull/1761#discussion_r55023665
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/table.scala
---
@@ -385,16 +387,23 @@ class GroupedTable(
.map(_._2).reduce( (x,y) => x ::: y)
// apply aggregations
- if (aggCalls.nonEmpty) {
- relBuilder.aggregate(groupKey, aggCalls.toIterable.asJava)
- }
+ relBuilder.aggregate(groupKey, aggCalls.toIterable.asJava)
// get selection expressions
- val exprs: List[RexNode] = extractedAggCalls
- .map(_._1)
- .map(toRexNode(_, relBuilder))
+ val exprs: List[RexNode] = try {
+ extractedAggCalls
+ .map(_._1)
+ .map(toRexNode(_, relBuilder))
+ }
+ catch {
+ case iae: IllegalArgumentException =>
+ throw new IllegalArgumentException(
+ "Only grouping fields and aggregations allowed after groupBy.",
iae)
--- End diff --
Wrong indention.
> Rework selection when grouping in Table API
> -------------------------------------------
>
> Key: FLINK-3567
> URL: https://issues.apache.org/jira/browse/FLINK-3567
> Project: Flink
> Issue Type: Bug
> Components: Table API
> Reporter: Timo Walther
> Assignee: Fabian Hueske
>
> {code}table.groupBy("a").select("e"){code}
> does not throw any exception.
> Fabian looked at the implementation of GroupedTable.select() and it looks
> incorrect. It does not group but just add a selection. Either we should
> reject the select or select the value an arbitrary row of the group.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)