-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set-returning UDFs #1604
Comments
@lightjacket in my opinion a better idea is to return a list in one row? |
@jimexist thanks for the suggestion! I did consider that as an alternative but would need to SELECT * FROM
(SELECT inverted_index_search('some query') as item_id) t
LEFT JOIN additional_data ON t.item_id = additional_data.item_id; Single row w/ a list SELECT * FROM
(SELECT unnest(inverted_index_search('some query')) as item_id) t
LEFT JOIN additional_data ON t.item_id = additional_data.item_id; So if the If there is an alternative to |
let's add unnest as it is more general: |
I'd argue that |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I'm looking at add an inverted index on my data and use it as the first step in more complicated data transformations. There's particular optimization that I think might be better done outside of the DataFusion engine.
Describe the solution you'd like
I'm imagining something like the following, where
inverted_index_search
returns an arbitrary number of rows.I'd like to be able to write a udf (or udaf, or something new) that can return as many rows as it needs.
Describe alternatives you've considered
I looked at having my UDF return an array, but once I had the array I could not figure out how to unnest it. Issue #212 looks to cover that, but I think it might be better to just have the function return multiple rows directly.
Additional context
Apologies if I missed something that is already available for this.
The text was updated successfully, but these errors were encountered: