YjyJeff commented on code in PR #9592: URL: https://github.com/apache/arrow-datafusion/pull/9592#discussion_r1522790718
########## datafusion/sqllogictest/test_files/unnest.slt: ########## @@ -254,5 +249,89 @@ select * from unnest([1,2,(select sum(column3) from unnest_table)]); 2 10 +## Unnest is the sub-expression of other expression +query II +select unnest(column1) as a, column3 from unnest_table; +---- +1 1 +2 1 +3 1 +4 2 +5 2 +6 3 +12 NULL + +query BI +select unnest(column1) is not null, column3 from unnest_table; +---- +true 1 +true 1 +true 1 +true 2 +true 2 +true 3 +true NULL + +query II +select -unnest(column1) as a, column3 from unnest_table; +---- +-1 1 +-2 1 +-3 1 +-4 2 +-5 2 +-6 3 +-12 NULL + +query II +select unnest(array_remove(column1, 3)) as a, column3 from unnest_table; +---- +1 1 +2 1 +4 2 +5 2 +6 3 +12 NULL + +query II +select unnest(array_remove(column1, 3)) as c1, column3 from unnest_table order by c1 desc, column3; +---- +12 NULL +6 3 +5 2 +4 2 +2 1 +1 1 + +query II +select unnest(array_remove(column1, 3)) - 1 as c1, column3 from unnest_table; +---- +0 1 +1 1 +3 2 +4 2 +5 3 +11 NULL + + +## Unnest multiple columns +query II +select unnest(column1), unnest(column2) from unnest_table; Review Comment: @jonahgao Agreed, I will remove this feature. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org