You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/07/08 00:38:52 UTC
(datafusion) 01/01: test: Add coverage for `NOT IN` predicates (#23378)
This is an automated email from the ASF dual-hosted git repository.
github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-23378-55292fb62337ba8b74fcd5f98c2638fcbae83b37
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit e65b3f378c5648b72d96d95a7f1210d750c153dc
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Tue Jul 7 20:38:28 2026 -0400
test: Add coverage for `NOT IN` predicates (#23378)
## Which issue does this PR close?
- related to https://github.com/apache/datafusion/issues/23307
## Rationale for this change
As @geoffreyclaude adds additional special implementations for IN lists
we should keep up with slt test coverage. The nullable integer coverage
already exercises `IN` with and without NULL list values; this adds the
corresponding negated `NOT IN` coverage.
## What changes are included in this PR?
This adds basic sqllogictest coverage for `NOT IN` predicates in
`in_list.slt`, covering each specialized integer type in the nullable IN
list table with and without NULL list values.
## Are these changes tested?
Tested by CI.
## Are there any user-facing changes?
No. This only adds test coverage.
---
datafusion/sqllogictest/test_files/in_list.slt | 38 ++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/datafusion/sqllogictest/test_files/in_list.slt b/datafusion/sqllogictest/test_files/in_list.slt
index b6656b7e0d..335266a4c3 100644
--- a/datafusion/sqllogictest/test_files/in_list.slt
+++ b/datafusion/sqllogictest/test_files/in_list.slt
@@ -214,6 +214,25 @@ match true true true true true true true true
no_match false false false false false false false false
nulls NULL NULL NULL NULL NULL NULL NULL NULL
+# NOT IN without NULL list values returns false for matches and true for non-matches.
+query TBBBBBBBB
+SELECT
+ label,
+ i8 NOT IN (3, 4, 5, 6, 11),
+ u8 NOT IN (3, 4, 5, 6, 11),
+ i16 NOT IN (3, 258, 4097, 16385, 11),
+ u16 NOT IN (3, 258, 4097, 16385, 11),
+ i32 NOT IN (3, 258, 66051, 16909060, 11),
+ u32 NOT IN (3, 258, 66051, 16909060, 11),
+ i64 NOT IN (3, 258, 66051, 16909060, 11),
+ u64 NOT IN (3, 258, 66051, 16909060, 11)
+FROM in_list_ints_nullable
+ORDER BY label
+----
+match false false false false false false false false
+no_match true true true true true true true true
+nulls NULL NULL NULL NULL NULL NULL NULL NULL
+
# Null IN list values return true for matches and NULL for non-matches.
query TBBBBBBBB
SELECT
@@ -233,6 +252,25 @@ match true true true true true true true true
no_match NULL NULL NULL NULL NULL NULL NULL NULL
nulls NULL NULL NULL NULL NULL NULL NULL NULL
+# Null IN list values return false for matches and NULL for non-matches with NOT IN.
+query TBBBBBBBB
+SELECT
+ label,
+ i8 NOT IN (NULL, 3, 4, 5, 11),
+ u8 NOT IN (NULL, 3, 4, 5, 11),
+ i16 NOT IN (NULL, 3, 258, 4097, 11),
+ u16 NOT IN (NULL, 3, 258, 4097, 11),
+ i32 NOT IN (NULL, 3, 258, 66051, 11),
+ u32 NOT IN (NULL, 3, 258, 66051, 11),
+ i64 NOT IN (NULL, 3, 258, 66051, 11),
+ u64 NOT IN (NULL, 3, 258, 66051, 11)
+FROM in_list_ints_nullable
+ORDER BY label
+----
+match false false false false false false false false
+no_match NULL NULL NULL NULL NULL NULL NULL NULL
+nulls NULL NULL NULL NULL NULL NULL NULL NULL
+
# Cleanup
statement ok
DROP TABLE in_list_ints_nullable
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org