@@ -33,7 +33,7 @@ AS VALUES
3333statement ok
3434CREATE TABLE nested_unnest_table
3535AS VALUES
36- (struct('a', 'b', struct('c')), (struct('a', 'b', [10,20])), [struct('a', 'b')]),
36+ (struct('a', 'b', struct('c')), (struct('a', 'b', [10,20])), [struct('a', 'b')]),
3737 (struct('d', 'e', struct('f')), (struct('x', 'y', [30,40, 50])), null)
3838;
3939
@@ -780,3 +780,55 @@ NULL 1
780780### TODO: group by unnest struct
781781query error DataFusion error: Error during planning: Projection references non\-aggregate values
782782select unnest(column1) c1 from nested_unnest_table group by c1.c0;
783+
784+ query II??I??
785+ select unnest(column5), * from unnest_table;
786+ ----
787+ 1 2 [1, 2, 3] [7] 1 [13, 14] {c0: 1, c1: 2}
788+ 3 4 [4, 5] [8, 9, 10] 2 [15, 16] {c0: 3, c1: 4}
789+ NULL NULL [6] [11, 12] 3 NULL NULL
790+ 7 8 [12] [, 42, ] NULL NULL {c0: 7, c1: 8}
791+ NULL NULL NULL NULL 4 [17, 18] NULL
792+
793+ query TT????
794+ select unnest(column1), * from nested_unnest_table
795+ ----
796+ a b {c0: c} {c0: a, c1: b, c2: {c0: c}} {c0: a, c1: b, c2: [10, 20]} [{c0: a, c1: b}]
797+ d e {c0: f} {c0: d, c1: e, c2: {c0: f}} {c0: x, c1: y, c2: [30, 40, 50]} NULL
798+
799+ query ?????
800+ select unnest(unnest(column3)), * from recursive_unnest_table
801+ ----
802+ [1] [[1, 2]] {c0: [1], c1: a} [[[1], [2]], [[1, 1]]] [{c0: [1], c1: [[1, 2]]}]
803+ [2] [[3], [4]] {c0: [2], c1: b} [[[3, 4], [5]], [[, 6], , [7, 8]]] [{c0: [2], c1: [[3], [4]]}]
804+
805+ statement ok
806+ CREATE TABLE join_table
807+ AS VALUES
808+ (1, 2, 3),
809+ (2, 3, 4),
810+ (4, 5, 6)
811+ ;
812+
813+ query IIIII
814+ select unnest(u.column5), j.* from unnest_table u join join_table j on u.column3 = j.column1
815+ ----
816+ 1 2 1 2 3
817+ 3 4 2 3 4
818+ NULL NULL 4 5 6
819+
820+ query II?I?
821+ select unnest(column5), * except (column5, column1) from unnest_table;
822+ ----
823+ 1 2 [7] 1 [13, 14]
824+ 3 4 [8, 9, 10] 2 [15, 16]
825+ NULL NULL [11, 12] 3 NULL
826+ 7 8 [, 42, ] NULL NULL
827+ NULL NULL NULL 4 [17, 18]
828+
829+ query III
830+ select unnest(u.column5), j.* except(column2, column3) from unnest_table u join join_table j on u.column3 = j.column1
831+ ----
832+ 1 2 1
833+ 3 4 2
834+ NULL NULL 4
0 commit comments