jorgecarleitao commented on pull request #9331:
URL: https://github.com/apache/arrow/pull/9331#issuecomment-768803567


   Thanks a lot for digging into it, @maxburke . fyi, there is no need to share 
the data. For this exercise we only need:
   
   * the input schema
   * the SQL statement
   * the column name where that appeared
   
   The invariant is:
   
   > the downcast of `&dyn Array` to a concrete type `T: Array` is infalible 
iff `T` is the corresponding `struct` for the `DataType` of the associated 
`Field`.
   
   For example,
   
   ```rust 
   let field = record_batch.schema().field(0);
   let array = record_batch.column(0);
   
   let meta_is_string = field.data_type() == DataType::Utf8;
   let data_is_string = array.as_any().downcast_ref::<StringArray>().is_some();
   
   assert_eq!(meta_is_string, data_is_string)
   ```
   
   and the above holds for every pair `(DataType, T: Array)`.


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

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


Reply via email to