snuyanzin commented on code in PR #25362:
URL: https://github.com/apache/flink/pull/25362#discussion_r1768373194


##########
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:
   after looking once more i think in assignment we could also check kind op 
operator under it and apply the required logic.



-- 
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]

Reply via email to