alamb opened a new issue, #6162:
URL: https://github.com/apache/arrow-rs/issues/6162

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   While working to enable `StringView` use more widely in DataFusion in 
https://github.com/apache/datafusion/pull/11723 I found  this cast function was 
not supported:
   
   Specifically, create a 
[`BinaryViewArray`](https://docs.rs/arrow/latest/arrow/array/type.BinaryViewArray.html)
 and then call 
[`cast`](https://docs.rs/arrow/latest/arrow/compute/kernels/cast/index.html) to 
cast it to Utf8:
   
   ```rust
   cast(binary_view_array, &DataType::Utf8)
   ```
   
   ```
   External error: query failed: DataFusion error: Error during planning: 
Cannot cast file schema field string_col of type BinaryView to table schema 
field of type Utf8
   ```
   
   I think this came about if a column is marked as "binary" in a parqut file 
and DataFusion tries to read it in as a Utf8 column the reader will be unbappy
   
   **Describe the solution you'd like**
   Add the support to the cast kernel for `BinaryView` -> utf8
   
   @RinChanNOWWW added most support in #5704 and I think we can simply use the  
`cast_view_to_byte`  function to build the correct `StringArray`
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   **Additional context**
   FYI @XiangpengHao 
   


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