Skip to content

Commit

Permalink
test(12733): reproducers for schema bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedld committed Nov 7, 2024
1 parent 40ba092 commit f8b1a4d
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions datafusion/sqllogictest/test_files/metadata.slt
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,58 @@ LIMIT 1;
2020-09-08T13:42:29.190855123Z



# distinct
query P
SELECT
DISTINCT ts as dist
FROM table_with_metadata;
----
2020-09-08T13:42:29.190855123

# Regression test: distinct with cast
statement error DataFusion error: Internal error: Physical input schema should be the same as the one converted from logical input schema
SELECT DISTINCT (ts::DATE) AS dist
FROM table_with_metadata;



# count distinct with group by
query II
SELECT
id AS grp,
COUNT(DISTINCT nonnull_name) as dist
FROM table_with_metadata
GROUP BY grp
order by 1 asc nulls last;
----
1 1
3 1
NULL 1

# count (not distinct) & cast, with group by
query TI
SELECT
CAST(id AS TEXT) AS grp,
COUNT(nonnull_name) as dist
FROM table_with_metadata
GROUP BY grp
order by 1 asc nulls last;
----
1 1
3 1
NULL 1

# Regression test: count distinct & cast, with group by
statement error DataFusion error: Internal error: Physical input schema should be the same as the one converted from logical input schema
SELECT
CAST(id AS TEXT) AS grp,
COUNT(DISTINCT nonnull_name) as dist
FROM table_with_metadata
GROUP BY grp
order by 1 asc nulls last;



statement ok
drop table table_with_metadata;

0 comments on commit f8b1a4d

Please sign in to comment.