Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion datafusion/sqllogictest/test_files/dictionary.slt
Original file line number Diff line number Diff line change
Expand Up @@ -632,4 +632,22 @@ south 2
statement ok
DROP TABLE dict_count_distinct;


# same dictionary type but value order differs across batches so key ids refer to different strings;
# grouping must use the logical value, not the raw key id
query TI rowsort
WITH
first_batch AS (
SELECT arrow_cast(column1, 'Dictionary(Int32, Utf8)') AS region
FROM (VALUES ('west'), ('west'), ('west'), ('east'), (NULL)) AS t(column1)
),
second_batch AS (
SELECT arrow_cast(column1, 'Dictionary(Int32, Utf8)') AS region
FROM (VALUES ('east'), ('east'), ('east'), ('west'), (NULL)) AS t(column1)
)
SELECT region, count(*)
FROM (SELECT region FROM first_batch UNION ALL SELECT region FROM second_batch)
GROUP BY region;
----
NULL 2
east 4
west 4
Loading