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

    https://github.com/apache/flink/pull/3252#discussion_r100995825
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/rules/datastream/DataStreamAggregateRule.scala
 ---
    @@ -159,9 +152,25 @@ class LogicalWindowAggregateRule
         }
         false
       }
    +
    +  private def rewriteTimeIndicatorOperators(agg: LogicalAggregate, 
groupExprIdx: Int) = {
    +    val project = 
agg.getInput.asInstanceOf[HepRelVertex].getCurrentRel.asInstanceOf[LogicalProject]
    +    val newProjectExpr = mutable.ArrayBuffer[RexNode]()
    +    newProjectExpr.appendAll(project.getChildExps)
    +    val rexBuilder = agg.getCluster.getRexBuilder
    +    newProjectExpr(groupExprIdx) = rexBuilder.makeTimestampLiteral(
    +      DataStreamAggregateRule.TIMESTAMP_ZERO, 3)
    +    val newProject = project.copy(project.getTraitSet, project.getInput,
    +      newProjectExpr, project.getRowType)
    +
    +    agg.copy(agg.getTraitSet, 
List(newProject)).asInstanceOf[LogicalAggregate]
    --- End diff --
    
    Can we create here a `LogicalAggregate` with adapted `groupSet`? 
    I think adding the `windowingGroupSet` to the `LogicalWindowAggregate` is 
not a very nice solution. It would be better if we could keep the existing code 
as it is without introducing workarounds for the SQL case.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to