You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "BubbaJoe (via GitHub)" <gi...@apache.org> on 2023/06/16 03:47:39 UTC

[GitHub] [arrow-datafusion] BubbaJoe opened a new issue, #6694: bug: array_position not working as expected

BubbaJoe opened a new issue, #6694:
URL: https://github.com/apache/arrow-datafusion/issues/6694

   ### Describe the bug
   
   `select array_position(array_field, 'NOT_EXIST') from rooms`
   
   when searching for a field that doesn't exist, i get this:
   `Arrow error: Invalid argument error: column types must match schema types, expected UInt8 but found Null at column index 0`
   FYI: there are no nulls in my array_field columns or in the inner list and they all of the same length.
   
   More importantly, when searching for something that does exist:
   `select coalesce(array_position(rooms.user_ids, 'administrator'), -1) from rooms`
   
   I get the number 15 for all rows. I am not sure what these means, i was expecting the index of the specific row, and across all rows.
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   I expected to get NULL for all rows that do have the specified element and the element of the specific array for the rows that do.
   
   ### Additional context
   
   A lot of the array functions are buggy and/or not so intuitive. I think the documentation should specify whether the function is aggregate or not. It's not so obvious by the current descriptions.
   
   Examples in the docs would also be nice, if you feel like words don't do justice.


-- 
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.apache.org

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