r-priyam commented on issue #37625:
URL: https://github.com/apache/arrow/issues/37625#issuecomment-1711557347

   Hi @js8544, Thank you for getting back.
   >I don't see any dictionary in your example though. Am I missing something? 
The array you provided is of type list<item: struct<key: int64>>
   
   Apologies, you're right, my bad.
   
   When I do -
   ```py
   >>> arr = pa.array([[{'key': 1}], None, None])
   >>> pa.compute.coalesce(arr, pa.scalar([None], 
type=pa.list_(pa.struct([('key', pa.int64())])))).flatten()
   <pyarrow.lib.StructArray object at 0x12f4a4b20>
   -- is_valid:
     [
       true,
       false,
       false
     ]
   -- child 0 type: int64
     [
       1,
       null,
       null
     ]
   ```
   It gives me exactly what I want. But then when I do -
   ```py
   >>> arr = pa.compute.coalesce(pa.array([[{'key': 1}], None, None]), 
pa.scalar([None], type=pa.list_(pa.struct([('key', pa.int64())])))).flatten()
   >>> arr_two = pa.array([None, 2, None])
   >>> arr_three = pa.array([None, None, 3])
   >>> pa.compute.coalesce(arr, arr_two, arr_three)
   # It throws
   File "pyarrow/_compute.pyx", line 367, in pyarrow._compute.Function.call
     File "pyarrow/error.pxi", line 144, in 
pyarrow.lib.pyarrow_internal_check_status
     File "pyarrow/error.pxi", line 121, in pyarrow.lib.check_status
   pyarrow.lib.ArrowNotImplementedError: Function 'coalesce' has no kernel 
matching input types (struct<key: int64>, int64, int64)
   ```
   In last my aim is to get output in a list `[1, 2, 3]`. Any suggestions on 
this please?
   


-- 
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