alamb commented on issue #105:
URL: https://github.com/apache/arrow-rs/issues/105#issuecomment-4308868593

   Here is the reproduction script I used to verify this:
   
   ```rust
   use arrow_json::ReaderBuilder;
   use arrow_schema::{DataType, Field, Schema};
   use std::sync::Arc;
   use std::io::Cursor;
   
   fn main() {
       let schema = Arc::new(Schema::new(vec![
           Field::new("a", DataType::Int32, true),
       ]));
   
       let json = r#"{"a": "not_an_int"}"#;
       let cursor = Cursor::new(json);
   
       let reader = ReaderBuilder::new(schema).build(cursor);
       
       match reader {
           Ok(mut reader) => {
               let result = reader.next();
               match result {
                   Some(Err(e)) => println!("Found expected error: {}", e),
                   Some(Ok(batch)) => {
                       println!("Batch read successfully (unexpected): {:?}", 
batch);
                   }
                   None => println!("No batch read"),
               }
           }
           Err(e) => println!("Error building reader: {}", e),
       }
   }
   ```
   
   Output:
   ```
   Found expected error: Json error: whilst decoding field 'a': failed to parse 
"not_an_int" as Int32
   ```


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