test: add sqllogictest coverage for DISTINCT / GROUP BY / aggregation on map columns#23406
Open
PG1204 wants to merge 4 commits into
Open
test: add sqllogictest coverage for DISTINCT / GROUP BY / aggregation on map columns#23406PG1204 wants to merge 4 commits into
PG1204 wants to merge 4 commits into
Conversation
Jefffrey
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Rationale for this change
SELECT DISTINCTon map columns used to fail withArrowError(NotYetImplemented)because arrow-rs'sRowConverterdid not support Map types. That support has since landed upstream (apache/arrow-rs#7879) and is available on DataFusion main via arrow 59.1, so these queries now work. As suggested in #15428 (comment) (maintainer comment), this PR adds sqllogictest coverage to lock in the behavior and close the issue.What changes are included in this PR?
Adds a new test section to
datafusion/sqllogictest/test_files/map.sltcovering:SELECT DISTINCTon a map column, including the exact reproducer from the issue (DISTINCT ... LIMIT), collapsing of duplicate maps and duplicate NULLs, andDISTINCTover map + scalar columns togetherGROUP BYon a map column,GROUP BYmap + scalar keys, andHAVINGwith a map grouping keyCOUNT(map),COUNT(DISTINCT map),SUMgrouped by map, andarray_aggof map valuesDISTINCT(equal to each other, distinct fromNULL), NULL maps, and unsorted maps with the same entries in different order being treated as distinct valuesUNION(distinct) on map columnsDISTINCT/GROUP BYover the existing 209-rowparquet_map.parquetfile for coverage on real Parquet-backed map dataNote: a bare
MAP {'key': NULL}literal infers aNullvalue type and fails type coercion across a VALUES list againstMap(Utf8, Int64)rows, so the test usesCAST(NULL AS BIGINT)for the null map value. That coercion gap may be worth a separate follow-up issue.Are these changes tested?
Yes, this PR is test-only. All tests pass locally via
cargo test -p datafusion-sqllogictest --test sqllogictests -- map.slt.Are there any user-facing changes?
No. Test-only change; no API or behavior changes.