MartijnVisser commented on code in PR #29423:
URL: https://github.com/apache/flink/pull/29423#discussion_r4223716071


##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdWindowProperties.scala:
##########
@@ -435,10 +436,16 @@ class FlinkRelMdWindowProperties private extends 
MetadataHandler[FlinkMetadata.W
     def inferWindowPropertyAfterWindowJoin(
         leftWindowProperty: ImmutableBitSet,
         rightWindowProperty: ImmutableBitSet): ImmutableBitSet = {
+      // window columns on an outer join's null-generating side become 
nullable, so they are no
+      // longer valid window properties
+      val preservedLeft =
+        if (joinType.generatesNullsOnLeft) ImmutableBitSet.of() else 
leftWindowProperty
+      val preservedRight =

Review Comment:
   I think this turns a window join or window Top-N on the null side's columns 
into a regular `Join` or `Rank`. Is that intended?



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/WindowJoinSemanticTests.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.planner.plan.nodes.exec.stream;
+
+import 
org.apache.flink.table.planner.plan.nodes.exec.testutils.SemanticTestBase;
+import org.apache.flink.table.test.program.TableTestProgram;
+
+import java.util.List;
+
+/** Semantic tests for a window aggregate on top of a {@link 
StreamExecWindowJoin}. */
+public class WindowJoinSemanticTests extends SemanticTestBase {
+
+    @Override
+    public List<TableTestProgram> programs() {
+        return List.of(

Review Comment:
   Also dropping the preserved side keeps these, `WindowAggregateTest` and 
`WindowJoinTest` green. Can you add plan tests for a LEFT join grouped on the 
left side staying a `WindowAggregate`, and for the join and Top-N fallback?



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