ArianaVillegas commented on PR #13334:
URL: https://github.com/apache/arrow/pull/13334#issuecomment-1151241093

   > I'm not sure I understand the question. Which type would you cast the 
values to? (and/or can give you a concrete example?)
   
   Sure, for example, if we have a dictionary d, we'll have an indices array, a 
values array, and a dictionary type with indices and values types.
   ```
   indices = dict_array.indices();
   values = dict_array.dictionary();
   dict_type = dict_array.dict_type();
   indices_type = dict_type->index_type();
   values_type = dict_type->value_type();
   ``` 
   And, I want to know whether it's possible to cast indices into an array of 
indices_type or not. The main reason I want to cast the indices array is to use 
`GetView`. Or can I get an `uint64_t` from a `Scalar`?
   
   And another question (OOT), can we build and array from a dictionary array? 
Something like this:
   ```
   values = [ b, null, c, a]
   indices = [0, null, 1, 0, 2, 3]
   
   final_array = [b, null, null, b, c, a]
   ```


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