Skip to content

test: add IN list slt coverage for temporal, Decimal128 and Interval types - #23875

Open
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/in-list-slt-temporal-decimal
Open

test: add IN list slt coverage for temporal, Decimal128 and Interval types#23875
alamb wants to merge 1 commit into
apache:mainfrom
alamb:alamb/in-list-slt-temporal-decimal

Conversation

@alamb

@alamb alamb commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

IN lists over temporal, Decimal128 and Interval columns had no SQL level coverage at all, and the specializations being added in #23014 route those types onto new code paths.

What changes are included in this PR?

Adds in_list.slt coverage for Date32, Date64, Time32(Second), Time64(Nanosecond), Timestamp(Nanosecond, None), Timestamp(Second, "UTC"), Duration(Second), Decimal128 and Interval(MonthDayNano)

Are these changes tested?

This PR is only tests; they pass on main and against the head of #23014.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Jul 24, 2026
@codecov-commenter

codecov-commenter commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.65%. Comparing base (88365dd) to head (a3fd8f3).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23875      +/-   ##
==========================================
- Coverage   80.65%   80.65%   -0.01%     
==========================================
  Files        1093     1093              
  Lines      371619   371619              
  Branches   371619   371619              
==========================================
- Hits       299730   299721       -9     
- Misses      53993    54001       +8     
- Partials    17896    17897       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…types

Part of apache#23307.

Adds sqllogictest coverage for IN lists over Date32, Date64, Time32,
Time64, Timestamp (with and without a timezone), Duration, Decimal128
and Interval(MonthDayNano), none of which had any SQL level coverage.

Also adds a 17 element Int8/UInt8 list and a 9 element Float16 list so
the bitmap specialization stays covered as shorter lists gain their own
specializations.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@alamb
alamb force-pushed the alamb/in-list-slt-temporal-decimal branch from 6d501e6 to a3fd8f3 Compare July 26, 2026 16:06
@alamb
alamb marked this pull request as ready for review July 26, 2026 16:07

@nuno-faria nuno-faria left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @alamb, LGTM, I leave some minor suggestions below.

Also, according to the code coverage there are some uncovered IN cases with larger lists, like INT32. I don't know if it is important.

Image

Comment on lines +371 to +380
CREATE TABLE in_list_temporal AS
SELECT
label,
arrow_cast(arrow_cast(value, 'Int32'), 'Date32') AS d32,
arrow_cast(arrow_cast(value, 'Int64'), 'Date64') AS d64,
arrow_cast(arrow_cast(value, 'Int32'), 'Time32(Second)') AS t32s,
arrow_cast(arrow_cast(value, 'Int64'), 'Time64(Nanosecond)') AS t64ns,
arrow_cast(arrow_cast(value, 'Int64'), 'Timestamp(Nanosecond, None)') AS ts_ns,
arrow_cast(arrow_cast(value, 'Int64'), 'Timestamp(Second, Some("UTC"))') AS ts_s_utc,
arrow_cast(arrow_cast(value, 'Int64'), 'Duration(Second)') AS dur_s

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The aliases are not aligned, if that was the idea 😄.

Comment on lines +391 to +397
d32 IN (arrow_cast(arrow_cast(3, 'Int32'), 'Date32'), arrow_cast(arrow_cast(4, 'Int32'), 'Date32'), arrow_cast(arrow_cast(5, 'Int32'), 'Date32'), arrow_cast(arrow_cast(11, 'Int32'), 'Date32')),
d64 IN (arrow_cast(arrow_cast(3, 'Int64'), 'Date64'), arrow_cast(arrow_cast(4, 'Int64'), 'Date64'), arrow_cast(arrow_cast(5, 'Int64'), 'Date64'), arrow_cast(arrow_cast(11, 'Int64'), 'Date64')),
t32s IN (arrow_cast(arrow_cast(3, 'Int32'), 'Time32(Second)'), arrow_cast(arrow_cast(4, 'Int32'), 'Time32(Second)'), arrow_cast(arrow_cast(5, 'Int32'), 'Time32(Second)'), arrow_cast(arrow_cast(11, 'Int32'), 'Time32(Second)')),
t64ns IN (arrow_cast(arrow_cast(3, 'Int64'), 'Time64(Nanosecond)'), arrow_cast(arrow_cast(4, 'Int64'), 'Time64(Nanosecond)'), arrow_cast(arrow_cast(5, 'Int64'), 'Time64(Nanosecond)'), arrow_cast(arrow_cast(11, 'Int64'), 'Time64(Nanosecond)')),
ts_ns IN (arrow_cast(arrow_cast(3, 'Int64'), 'Timestamp(Nanosecond, None)'), arrow_cast(arrow_cast(4, 'Int64'), 'Timestamp(Nanosecond, None)'), arrow_cast(arrow_cast(5, 'Int64'), 'Timestamp(Nanosecond, None)'), arrow_cast(arrow_cast(11, 'Int64'), 'Timestamp(Nanosecond, None)')),
ts_s_utc IN (arrow_cast(arrow_cast(3, 'Int64'), 'Timestamp(Second, Some("UTC"))'), arrow_cast(arrow_cast(4, 'Int64'), 'Timestamp(Second, Some("UTC"))'), arrow_cast(arrow_cast(5, 'Int64'), 'Timestamp(Second, Some("UTC"))'), arrow_cast(arrow_cast(11, 'Int64'), 'Timestamp(Second, Some("UTC"))')),
dur_s IN (arrow_cast(arrow_cast(3, 'Int64'), 'Duration(Second)'), arrow_cast(arrow_cast(4, 'Int64'), 'Duration(Second)'), arrow_cast(arrow_cast(5, 'Int64'), 'Duration(Second)'), arrow_cast(arrow_cast(11, 'Int64'), 'Duration(Second)'))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this test and the others, I don't think the double arrow_cast is needed, only for Time32:

> select arrow_cast(3, 'Date32');
+-------------------------------------+
| arrow_cast(Int64(3),Utf8("Date32")) |
+-------------------------------------+
| 1970-01-04                          |
+-------------------------------------+

> select arrow_cast(3, 'Time32');
Execution error: Unsupported type 'Time32'. Must be a supported arrow type name such as 'Int32' or 'Timestamp(ns)'. Error finding next token

Comment on lines +463 to +478
####
## Decimal128 IN List Specializations
####

statement ok
CREATE TABLE in_list_wide AS
SELECT * FROM (VALUES
('match', arrow_cast(11, 'Decimal128(10, 2)'), INTERVAL '11 months'),
('no_match', arrow_cast(7, 'Decimal128(10, 2)'), INTERVAL '7 months'),
('nulls', NULL, NULL)
) AS t(label, d128, imdn);

query TT
SELECT arrow_typeof(d128), arrow_typeof(imdn) FROM in_list_wide LIMIT 1
----
Decimal128(10, 2) Interval(MonthDayNano)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should Decimal128 and INTERVAL maybe be split into different tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants