alamb commented on code in PR #3136:
URL: https://github.com/apache/arrow-datafusion/pull/3136#discussion_r946030094


##########
datafusion-cli/src/command.rs:
##########
@@ -72,6 +76,22 @@ impl Command {
                     .print_batches(&batches, now)
                     .map_err(|e| DataFusionError::Execution(e.to_string()))
             }
+            Self::Include(filename) => {
+                if let Some(filename) = filename {
+                    let file = match File::open(filename) {
+                        Ok(file) => file,
+                        Err(error) => {
+                            return 
Err(DataFusionError::Execution(error.to_string()))
+                        }

Review Comment:
   Yeah, something like this perhaps?
   
   ```suggestion
                       let file =  File::open(filename)
                           .map_err(|e| {
                               DataFusionError::Execution(format!("Error 
opening {:?} {}", filename, e))
                           })?;                  
   ```
   
   As the `e` doesn't contain the filename
   
   This gives something like: 
   
   ```sql
   ❯ \i /tmp/foo.dd
   Execution error: Error opening "/tmp/foo.dd" No such file or directory (os 
error 2)
   ```



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