DDtKey opened a new issue, #4886:
URL: https://github.com/apache/arrow-datafusion/issues/4886

   **Describe the bug**
   
   > See note in `Additional context` 
   
   I'm not sure if it's by design or bug, but `ArrowError` could be raised 
under `External` of himself one, instead of dedicated one.
   
   It looks incorrect to me, because it mixes possible variants, i.e to check 
`ArrowError` I have to check **three** enum variants and **downcast** one of 
them.
   
   Moreover I'm not sure if it's possible for `External` of `DataFusionError`, 
but for `DataFusionError` has the following description for this variant:
   > Errors originating from outside DataFusion's core codebase. For example, a 
custom S3Error from the crate datafusion-objectstore-s3
   
   But what does `External` mean for `ArrowError`? (not documented) 🤔 
   
   **To Reproduce**
   One of the possible examples is:
   
   File:
   ```csv
   age
   27
   28.6
   ```
   
   Code:
   ```rs
       let schema = Schema::new(vec![Field::new("age", DataType::Int64, 
false)]);
   
       ctx.register_csv(
           "test",
           path,
           CsvReadOptions::default().schema(&schema).delimiter(b','),
       )
       .await?;
       
       let data_frame = ctx
           .sql("SELECT t.age as year FROM test t WHERE t.age > 20")
           .await?;
   ```
   
   It will return:
   ```
   Error: Arrow error: External error: Arrow error: Parser error: Error while 
parsing value 28.6 for column 0 at line 2
   ```
   While I expect just `Error: Arrow error: Parser error: ...`
   This case especially weird, because it's self-hiding (`ArrowError` inside 
`ArrowError` under `External`  variant!) and it could be recursion at all (I 
don't know how deep it could be)
   
   **Expected behavior**
   It's messy and hard to handle all possible errors. 
   
   I'd like to be able to rely on error-types by some rules, because rust match 
system is really good for that. 
   And don't expect types wrapped to themselves, because it could be considered 
as recursive.
   
   **Additional context**
   
   I believe it's related more to https://github.com/apache/arrow-rs, but I'm 
not sure about usage pattern in datafusion to repro it only by arrow for MRE.
   
   So feel free to close it and address to `arrow-rs` with simplified example


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