datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Add `union_extract` function

Open gstvg opened this issue 1 year ago • 1 comments

Is your feature request related to a problem or challenge?

Retrieve the value of the given union variant, or NULL if it's not currently selected

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

DuckDB has such function, I propose using the same name https://duckdb.org/docs/sql/functions/nested.html#union_extractunion-tag

gstvg avatar Jun 23 '24 15:06 gstvg

take

gstvg avatar Jun 23 '24 15:06 gstvg

Hi @gstvg!

I have a question regarding this issue. We are currently working on a prototype that would require "ergonomic" handling of unions for filtering etc. I understand that you have implemented a union_extract kernel in arrow-rs. Is there a reason on why the API of using this kernel wasn't merged into DataFusion? Or is there already another way to achieve the semantics of extract_union?

I'd also be happy to give a hand if there's something that I could do.

tobixdev avatar Jan 08 '25 14:01 tobixdev

Hi @tobixdev

My bad, the arrow kernel ended up being enough for me and I got busy with other work, leaving this for later. I'm already started updating #12116, I should push it soon. I'll ping you there in case you wanna take a look

gstvg avatar Jan 14 '25 17:01 gstvg

The duckdb naming is unfortunate, so easy to confuse with sql union.

Omega359 avatar Feb 07 '25 12:02 Omega359