datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

add 'unnest' table function

Open l1t1 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem or challenge?

the 'unnest' table function reads an array or list, and out put a table

Describe the solution you'd like

the result is same as that of postgresql

select unnest(ARRAY[1,2,3]);
 unnest
--------
      1
      2
      3

select * from unnest(ARRAY[1,2,3]);
 unnest
--------
      1
      2
      3

Describe alternatives you've considered

No response

Additional context

No response

l1t1 avatar Feb 23 '24 04:02 l1t1

I think it is duplicated issue from #6555 btw, first example is implemented

jayzhan211 avatar Feb 23 '24 05:02 jayzhan211

when will the function available?

l1t1 avatar Feb 23 '24 06:02 l1t1

first one should be available now. second one it not planned

jayzhan211 avatar Feb 23 '24 06:02 jayzhan211

take

jonahgao avatar Feb 26 '24 07:02 jonahgao

Unnest seems to be recognized as a TableFactor in sqlparser-rs, and implementing support for it in DataFusion might be straightforward.

I'll work on this issue after PR #9342.

jonahgao avatar Feb 26 '24 07:02 jonahgao