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

    https://github.com/apache/flink/pull/5706#discussion_r174965171
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/plan/nodes/logical/FlinkLogicalWindowAggregate.scala
 ---
    @@ -103,6 +106,19 @@ class FlinkLogicalWindowAggregateConverter
         FlinkConventions.LOGICAL,
         "FlinkLogicalWindowAggregateConverter") {
     
    +  override def matches(call: RelOptRuleCall): Boolean = {
    +    val agg = call.rel(0).asInstanceOf[LogicalWindowAggregate]
    +
    +    // we do not support these functions natively
    +    // they have to be converted using the 
WindowAggregateReduceFunctionsRule
    +    val supported = 
agg.getAggCallList.asScala.map(_.getAggregation.getKind).forall {
    +      case SqlKind.STDDEV_POP | SqlKind.STDDEV_SAMP | SqlKind.VAR_POP | 
SqlKind.VAR_SAMP => false
    --- End diff --
    
    How about AVG and SUM? they are also in AggregateReduceFunctionsRule. Also, 
I think it's better to use SqlKind.AVG_AGG_FUNCTIONS.contains() or 
AggregateReduceFunctionsRule.isReducible() (it's private now though) here in 
the case statement. So it will keep consistent if calcite changes.


---

Reply via email to