twalthr commented on code in PR #25362:
URL: https://github.com/apache/flink/pull/25362#discussion_r1768296119
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkCalciteSqlValidator.java:
##########
@@ -373,20 +375,30 @@ protected void addToSelectList(
final SqlOperator operator = call.getOperator();
if (operator instanceof SqlWindowTableFunction) {
- if (explicitTableArgs.stream().allMatch(Objects::isNull)) {
+ if (tableArgs.stream().allMatch(Objects::isNull)) {
return rewritten;
}
+ final boolean isSessionWindow = isSessionWindow(operator);
final List<SqlIdentifier> descriptors =
call.getOperandList().stream()
.flatMap(FlinkCalciteSqlValidator::extractDescriptors)
.collect(Collectors.toList());
for (int i = 0; i < call.operandCount(); i++) {
- final SqlIdentifier tableArg = explicitTableArgs.get(i);
+ final SqlIdentifier tableArg = tableArgs.get(i);
if (tableArg != null) {
final SqlNode opReplacement = new
ExplicitTableSqlSelect(tableArg, descriptors);
- if (call.operand(i).getKind() ==
SqlKind.ARGUMENT_ASSIGNMENT) {
+ if (isSessionWindow) {
Review Comment:
The logic should be independent of any specific window function. This is why
there was no explicit check for a TUMBLE, HOP, or CUMULATE. Just adding an
additional branch for `else if (call.operand(i).getKind() ==
SqlKind.SET_SEMANTICS_TABLE)` should do the job, no? It should apply to all
functions that with SET_SEMANTICS_TABLE args.
--
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]