godfreyhe commented on a change in pull request #9349: [FLINK-13564] 
[table-planner-blink] throw exception if constant with YEAR TO MONTH resolution 
was used for group windows
URL: https://github.com/apache/flink/pull/9349#discussion_r312348542
 
 

 ##########
 File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/BatchLogicalWindowAggregateRule.scala
 ##########
 @@ -73,6 +76,12 @@ class BatchLogicalWindowAggregateRule
           ref.getIndex)
     }
   }
+
+  def getOperandAsLong(call: RexCall, idx: Int): Long =
+    call.getOperands.get(idx) match {
+      case v: RexLiteral => v.getValue.asInstanceOf[JBigDecimal].longValue()
+      case _ => throw new TableException("Only constant window descriptors are 
supported")
 
 Review comment:
   this aligns with Flink planner, see 
[DataSetLogicalWindowAggregateRule](https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/plan/rules/dataSet/DataSetLogicalWindowAggregateRule.scala)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to