askoa commented on PR #3354:
URL: 
https://github.com/apache/arrow-datafusion/pull/3354#issuecomment-1238187811

   > For the reader case we are meeting here, I personally think it's OK to 
panic here since we are deserializing `RecordBatch` from `Vec<u8>` with a known 
row type. It must be a bug if we create a list of array builders according to 
the schema but cannot cast them to the corresponding type-specific builders 
later.
   
   I stumbled upon the [rust book 
article](https://doc.rust-lang.org/book/ch09-03-to-panic-or-not-to-panic.html) 
which suggests to return `Result` for recoverable error. If the error is not 
recoverable then `panic` is recommended.  I agree with @yjshen that the 
`read_field*` functions should result in panic as the error does not look 
recoverable. 
   
   If I don't get any opposing views, I'll revert the code for the 
`read_field*` functions and send updated PR.
   
    


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