You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: datafusion/sqllogictest/test_files/unnest.slt
+24-3Lines changed: 24 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -511,10 +511,19 @@ x y [30, 40, 50]
511
511
query error DataFusion error: type_coercion\ncaused by\nThis feature is not implemented: Unnest should be rewritten to LogicalPlan::Unnest before type coercion
512
512
select sum(unnest(generate_series(1,10)));
513
513
514
-
## TODO: support unnest as a child expr
515
514
query error DataFusion error: Internal error: unnest on struct can only be applied at the root level of select expression
516
515
select arrow_typeof(unnest(column5)) from unnest_table;
517
516
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
518
527
519
528
## unnest from a result of a logical plan with limit and offset
520
529
query I
@@ -524,10 +533,19 @@ select unnest(column1) from (select * from (values([1,2,3]), ([4,5,6])) limit 1
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.
529
537
select unnest(column1), unnest(column1) from unnest_table;
530
538
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
531
549
532
550
## the same unnest expr is referened multiple times (unnest is the bottom-most expr)
533
551
query ??II
@@ -777,10 +795,13 @@ select unnest(unnest(column2)) c2, count(column3) from recursive_unnest_table gr
0 commit comments