twalthr commented on code in PR #25362:
URL: https://github.com/apache/flink/pull/25362#discussion_r1768379745
##########
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:
I don't have a strong opinion on how we solve it. But we should not
explicitly need to hard code a operator name like SESSION. Otherwise we need to
touch this part for every PTF we are adding.
--
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]