You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "snuyanzin (via GitHub)" <gi...@apache.org> on 2026/10/07 20:13:28 UTC
[PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
snuyanzin opened a new pull request, #29423:
URL: https://github.com/apache/flink/pull/29423
## What is the purpose of the change
The problem is that for different joins the window properties are not maintained
as a result it fails while planning
The PR fixes this
## Verifying this change
semantic tests provided
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): ( no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
- The serializers: (no)
- The runtime per-record code paths (performance sensitive): (no)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
- The S3 file system connector: (no)
## Documentation
- Does this pull request introduce a new feature? (no)
- If yes, how is the feature documented? (not applicable )
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change the checkbox below to `[X]` and replace the placeholder in the "Generated-by"
line with the tool name and version. Otherwise remove the "Generated-by" line.
See the ASF Generative Tooling Guidance for details:
https://www.apache.org/legal/generative-tooling.html
You are responsible for the quality and correctness of every change in this PR
regardless of the tooling used. Low-effort AI-generated PRs will be closed. See
AGENTS.md for the full guidance.
-->
- [ ] Yes (please specify the tool below)
Generated-by: [Tool Name and Version]
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
Posted by "snuyanzin (via GitHub)" <gi...@apache.org>.
snuyanzin merged PR #29423:
URL: https://github.com/apache/flink/pull/29423
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #29423:
URL: https://github.com/apache/flink/pull/29423#issuecomment-6046104917
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "9bf62da15a38d787b7ca39ab15761a8eb6cfe005",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9bf62da15a38d787b7ca39ab15761a8eb6cfe005",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 9bf62da15a38d787b7ca39ab15761a8eb6cfe005 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
Posted by "och5351 (via GitHub)" <gi...@apache.org>.
och5351 commented on PR #29423:
URL: https://github.com/apache/flink/pull/29423#issuecomment-6060523446
Hi, @snuyanzin !
I've been following the Flink SQL side of things and got interested, so I looked into this PR together.
Confirmed that `joinType.generatesNullsOnLeft/Right` reuses the same pattern already used in `FlinkRelMdUniqueKeys`.
Also confirmed all tests pass.
Thanks for continuously contributing great features and bug fixes!
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-40948][table] Maintain window properties for different joins [flink]
Posted by "MartijnVisser (via GitHub)" <gi...@apache.org>.
MartijnVisser commented on code in PR #29423:
URL: https://github.com/apache/flink/pull/29423#discussion_r4390286359
##########
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:
Discussed offline and we agreed that there's no other way to get this done. LGTM
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org