snuyanzin commented on code in PR #25362:
URL: https://github.com/apache/flink/pull/25362#discussion_r1768348432
##########
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:
>else if (call.operand(i).getKind() == SqlKind.SET_SEMANTICS_TABLE) should
do the job, no?
in case of `SET_SEMANTICS_TABLES` yes
however there is still `SqlKind.ARGUMENT_ASSIGNMENT` which should be handled
differently because of how sqlSetSemanticsTableOperator looks like
https://github.com/apache/flink/blob/0e373b20d917a9bcd2b00e32d3ff09b353aef728/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkCalciteSqlValidator.java#L396-L400
vs
https://github.com/apache/flink/blob/0e373b20d917a9bcd2b00e32d3ff09b353aef728/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkCalciteSqlValidator.java#L401-L405
--
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]