Jimexist commented on a change in pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#discussion_r628701760
##########
File path: datafusion-cli/src/main.rs
##########
@@ -65,16 +77,90 @@ pub async fn main() {
execution_config = execution_config.with_batch_size(batch_size);
};
- let mut ctx =
-
ExecutionContext::with_config(execution_config.with_information_schema(true));
+ if let Some(file_path) = matches.value_of("file") {
+ let file = File::open(file_path)
+ .unwrap_or_else(|err| panic!("cannot open file '{}': {}",
file_path, err));
Review comment:
example error
```
❯ cargo run --release --bin datafusion-cli -q -- -f ./1.sql
thread 'main' panicked at 'cannot open file './1.sql': Permission denied (os
error 13)', datafusion-cli/src/main.rs:82:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
##########
File path: datafusion-cli/src/main.rs
##########
@@ -65,16 +77,90 @@ pub async fn main() {
execution_config = execution_config.with_batch_size(batch_size);
};
- let mut ctx =
-
ExecutionContext::with_config(execution_config.with_information_schema(true));
+ if let Some(file_path) = matches.value_of("file") {
+ let file = File::open(file_path)
+ .unwrap_or_else(|err| panic!("cannot open file '{}': {}",
file_path, err));
Review comment:
example error for when file is not readable
```
❯ cargo run --release --bin datafusion-cli -q -- -f ./1.sql
thread 'main' panicked at 'cannot open file './1.sql': Permission denied (os
error 13)', datafusion-cli/src/main.rs:82:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]