You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/18 15:25:17 UTC

[GitHub] [arrow-datafusion] lightjacket commented on issue #1604: Set-returning UDFs

lightjacket commented on issue #1604:
URL: https://github.com/apache/arrow-datafusion/issues/1604#issuecomment-1015521579


   @Jimexist thanks for the suggestion! I did consider that as an alternative but would need to `unnest` the result in order to be able to join against additional tables like so:
   Set-returning
   ```sql
   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
   ```sql
   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 `unnest` function existed, I would be unblocked. I _think_ if I could create a set-returning UDF I could also implement `unnest` myself as a user and wouldn't need to wait on a built-in `unnest`.
   
   If there is an alternative to `unnest` to get that join I am looking for though, that would absolutely work. I just haven't found it yet if it exists.


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org