gustavodemorais commented on code in PR #29558:
URL: https://github.com/apache/flink/pull/29558#discussion_r4361244167
##########
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/join/interval/RowTimeIntervalJoinTest.java:
##########
@@ -491,6 +491,96 @@ void testRowTimeFullOuterJoin() throws Exception {
testHarness.close();
}
+ @Test
+ void testDoesNotCacheRowsThatCanNeverMatch() throws Exception {
Review Comment:
Could we add a case with a composite key that is only partly null-safe
(filterNulls `{true, false}`)? All new tests use a single-field key
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/runtime/operators/join/interval/IntervalJoinFunction.java:
##########
@@ -90,4 +87,12 @@ public TypeInformation<RowData> getProducedType() {
public void setJoinKey(RowData currentKey) {
this.joinKey = (NullAwareGetters) currentKey;
}
+
+ /**
+ * Returns whether no record of the current join key can ever match,
because the key has a null
+ * in a field that is not null-safe. The join key must be set.
+ */
+ public boolean currentKeyCannotMatch() {
+ return !nullSafe && (filterAllNulls ? joinKey.anyNull() :
joinKey.anyNull(nullFilterKeys));
Review Comment:
nit: this repeats the body of `NullAwareJoinHelper#shouldFilter`. Could we
delegate to it, like `JoinConditionWithNullFilters` does, so the two don't
drift?
```suggestion
return NullAwareJoinHelper.shouldFilter(nullSafe, filterAllNulls,
nullFilterKeys, (BinaryRowData) joinKey);
```
--
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]