xuyangzhong commented on code in PR #23505:
URL: https://github.com/apache/flink/pull/23505#discussion_r1462628183
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/utils/WindowUtil.scala:
##########
@@ -234,11 +235,45 @@ object WindowUtil {
val step = getOperandAsLong(windowCall.operands(1))
val maxSize = getOperandAsLong(windowCall.operands(2))
new CumulativeWindowSpec(Duration.ofMillis(maxSize),
Duration.ofMillis(step), offset)
+ case FlinkSqlOperatorTable.SESSION =>
+ windowCall match {
+ // with syntax partition key
+ case setSemanticsTableCall: RexSetSemanticsTableCall =>
+ if (!setSemanticsTableCall.getOrderKeys.isEmpty) {
+ throw new ValidationException("Session window TVF doesn't
support order by clause.")
+ }
+ val gap = getOperandAsLong(windowCall.operands(1))
+ new SessionWindowSpec(
+ Duration.ofMillis(gap),
+
windowCall.asInstanceOf[RexSetSemanticsTableCall].getPartitionKeys.toArray)
+ // without syntax partition key
Review Comment:
Currently if there is not a `partition by` or `order by` in table function
when parsing, calcite will not create a SET_SEMANTICS_TABLE for it. See more in
`SqlParserImpl#CreateSetSemanticsTableIfNeeded`

--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]