[ 
https://issues.apache.org/jira/browse/FLINK-5303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15804955#comment-15804955
 ] 

ASF GitHub Bot commented on FLINK-5303:
---------------------------------------

Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2976#discussion_r94965456
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
 ---
    @@ -349,6 +354,19 @@ object AggregateUtil {
         (groupingOffsetMapping, aggOffsetMapping)
       }
     
    +  private def getGroupingSetsMapping(outputType: RelDataType): Array[(Int, 
Int)] = {
    +    val fields = outputType.getFieldList
    +    var mappingsBuffer = ArrayBuffer[(Int, Int)]()
    +    for (i <- fields.indices) {
    +      for (j <- fields.indices) {
    +        if (fields(j).getName.equals("i$" + fields(i).getName)) {
    --- End diff --
    
    I know that it is unlikely but this could result in undesired behavior if 
the table contains `i$test` and `test`. Isn't there a nicer way to determine 
the grouping set mappings.


> Add CUBE/ROLLUP/GROUPING SETS operator in SQL
> ---------------------------------------------
>
>                 Key: FLINK-5303
>                 URL: https://issues.apache.org/jira/browse/FLINK-5303
>             Project: Flink
>          Issue Type: New Feature
>          Components: Documentation, Table API & SQL
>            Reporter: Alexander Chermenin
>            Assignee: Alexander Chermenin
>
> Add support for such operators as CUBE, ROLLUP and GROUPING SETS in SQL.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to