Skip to content

Commit 6d61503

Browse files
authored
clean up the todo comments in unnest.slt (#12795)
1 parent c412c74 commit 6d61503

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

datafusion/sqllogictest/test_files/unnest.slt

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,19 @@ x y [30, 40, 50]
511511
query error DataFusion error: type_coercion\ncaused by\nThis feature is not implemented: Unnest should be rewritten to LogicalPlan::Unnest before type coercion
512512
select sum(unnest(generate_series(1,10)));
513513

514-
## TODO: support unnest as a child expr
515514
query error DataFusion error: Internal error: unnest on struct can only be applied at the root level of select expression
516515
select arrow_typeof(unnest(column5)) from unnest_table;
517516

517+
query T
518+
select arrow_typeof(unnest(column1)) from unnest_table;
519+
----
520+
Int64
521+
Int64
522+
Int64
523+
Int64
524+
Int64
525+
Int64
526+
Int64
518527

519528
## unnest from a result of a logical plan with limit and offset
520529
query I
@@ -524,10 +533,19 @@ select unnest(column1) from (select * from (values([1,2,3]), ([4,5,6])) limit 1
524533
5
525534
6
526535

527-
## FIXME: https://github.com/apache/datafusion/issues/11198
528536
query error DataFusion error: Error during planning: Projections require unique expression names but the expression "UNNEST\(unnest_table.column1\)" at position 0 and "UNNEST\(unnest_table.column1\)" at position 1 have the same name. Consider aliasing \("AS"\) one of them.
529537
select unnest(column1), unnest(column1) from unnest_table;
530538

539+
query II
540+
select unnest(column1), unnest(column1) u1 from unnest_table;
541+
----
542+
1 1
543+
2 2
544+
3 3
545+
4 4
546+
5 5
547+
6 6
548+
12 12
531549

532550
## the same unnest expr is referened multiple times (unnest is the bottom-most expr)
533551
query ??II
@@ -777,10 +795,13 @@ select unnest(unnest(column2)) c2, count(column3) from recursive_unnest_table gr
777795
[, 6] 1
778796
NULL 1
779797

780-
### TODO: group by unnest struct
781798
query error DataFusion error: Error during planning: Projection references non\-aggregate values
782799
select unnest(column1) c1 from nested_unnest_table group by c1.c0;
783800

801+
# TODO: this query should work. see issue: https://github.com/apache/datafusion/issues/12794
802+
query error DataFusion error: Internal error: unnest on struct can only be applied at the root level of select expression
803+
select unnest(column1) c1 from nested_unnest_table
804+
784805
query II??I??
785806
select unnest(column5), * from unnest_table;
786807
----

0 commit comments

Comments
 (0)