fpixl opened a new issue, #36911:
URL: https://github.com/apache/arrow/issues/36911

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   I'm running a few experiments with PyArrow Map type and can't figure out how 
to do a map lookup of nested keys using a `pyarrow.compute`. Here's my example:
   
   ```python
   import pyarrow as pa
   import pyarrow.compute as pc
   
   data = pa.array(
       [
           [
               ("A", [("x", 1), ("y", 0)]), 
               ("B", [("x", 0), ("y", 0)])
           ],
           [   
               ("A", [("x", 1), ("y", 0), ("z", 1)]), 
               ("C", [("x", 0), ("y", 0), ("z", 1)])
           ],
       ],
       type=pa.map_(pa.string(), pa.map_(pa.string(), pa.int8())),
   )
   
   pc.map_lookup(data, pa.scalar("A"), "all")
   ```
   
   This is what we get:
   ```python
   <pyarrow.lib.ListArray object at 0x13b692ec0>
   [
     [
       keys: ["x", "y"]
       values: [1, 0]
     ],
     [
       keys: ["x", "y", "z"]
       values: [1, 0, 1]
     ]
   ]
   ```
   
   Then tried `pc.map_lookup(data, pa.scalar("A.x"), "all")` but I get:
   
   ```python
   <pyarrow.lib.ListArray object at 0x13b693940>
   [
     null,
     null
   ]
   ```
   
   How do I get the values of `A.x`? 
   
   Thank you!
   
   ### Component(s)
   
   Python


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to