Skip to content

Commit

Permalink
clean up the todo comments in unnest.slt (apache#12795)
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal authored Oct 8, 2024
1 parent c412c74 commit 6d61503
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions datafusion/sqllogictest/test_files/unnest.slt
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,19 @@ x y [30, 40, 50]
query error DataFusion error: type_coercion\ncaused by\nThis feature is not implemented: Unnest should be rewritten to LogicalPlan::Unnest before type coercion
select sum(unnest(generate_series(1,10)));

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

query T
select arrow_typeof(unnest(column1)) from unnest_table;
----
Int64
Int64
Int64
Int64
Int64
Int64
Int64

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

## FIXME: https://github.com/apache/datafusion/issues/11198
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.
select unnest(column1), unnest(column1) from unnest_table;

query II
select unnest(column1), unnest(column1) u1 from unnest_table;
----
1 1
2 2
3 3
4 4
5 5
6 6
12 12

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

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

# TODO: this query should work. see issue: https://github.com/apache/datafusion/issues/12794
query error DataFusion error: Internal error: unnest on struct can only be applied at the root level of select expression
select unnest(column1) c1 from nested_unnest_table

query II??I??
select unnest(column5), * from unnest_table;
----
Expand Down

0 comments on commit 6d61503

Please sign in to comment.