tshauck opened a new pull request, #8856:
URL: https://github.com/apache/arrow-datafusion/pull/8856

   ## Which issue does this PR close?
   
   TODO:
   
   ## Rationale for this change
   
   The rationale is that currently when using the cli, if you use -c and -f, 
both of which are useful to use datafusion in workflows (e.g. and ETL 
pipeline), the exit code if the query fails is still 0. Most job orchestration 
tools can propagate the exit code from a CLI tool "up", so this makes using the 
CLI more ergonomic for that use case. 
   
   ## What changes are included in this PR?
   
   Generally, adds `Result` return enums so that the CLI will eventually return 
the 0 or 1 exit code to the caller. 
   
   ## Are these changes tested?
   
   I ran the `-c`, `-f`, and interactive mode. Things are functional, though 
the main difference I've noticed is the error printed out is a bit more verbose 
right now. E.g.
   
   ```
   ./target/debug/datafusion-cli -c 'SELECT hi';        
   DataFusion CLI v34.0.0
   Error: SchemaError(FieldNotFound { field: Column { relation: None, name: 
"hi" }, valid_fields: [] }, Some(""))
   
   echo $?;
   1
   ```
   
   If this is to be merged, I'll try to cleanup the error message, but I 
thought I'd open this to get feedback as to if this is something the project 
would consider merging.
   
   Thanks


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