You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/07 02:27:17 UTC

[GitHub] [arrow-datafusion] Jimexist opened a new pull request #285: allow datafusion-cli to take file param

Jimexist opened a new pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285


   # Which issue does this PR close?
   
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   
   Closes #282.
   
   Relies on #283 
   
    # Rationale for this change
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   
   Allow datafusion-cli to take file as a param.
   
   # What changes are included in this PR?
   
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   
   # Are there any user-facing changes?
   
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834019272


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#285](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2d62095) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/b8805d4f44d4da8f16069d93ab342dc6f082ca07?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b8805d4) will **decrease** coverage by `0.11%`.
   > The diff coverage is `0.00%`.
   
   > :exclamation: Current head 2d62095 differs from pull request most recent head 0789a4f. Consider uploading reports for the commit 0789a4f to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/285/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #285      +/-   ##
   ==========================================
   - Coverage   76.19%   76.07%   -0.12%     
   ==========================================
     Files         140      140              
     Lines       23595    23632      +37     
   ==========================================
     Hits        17978    17978              
   - Misses       5617     5654      +37     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion-cli/src/main.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/285/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi1jbGkvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b8805d4...0789a4f](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on a change in pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#discussion_r628545062



##########
File path: datafusion-cli/src/main.rs
##########
@@ -65,16 +77,91 @@ 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) = matches
+        .value_of("file")
+        .and_then(|file| File::open(&file).ok())

Review comment:
       I think the use of `ok()` silently ignore errors when opening the file and silently fallback to the repl. This leads to strange behavior for certain files, such as those that that exists, but I don't have permissions to read
   
   For a file such as this, I would expect `datafusion-cli` to generate an error about permissions:
   
   ```
   (arrow_dev) alamb@ip-10-0-0-124:~/Software/arrow-datafusion$ ls -l /tmp/foo.sql 
   --w-------  1 alamb  wheel     0B May  7 17:30 /tmp/foo.sql
   
   (arrow_dev) alamb@ip-10-0-0-124:~/Software/arrow-datafusion$ cat /tmp/foo.sql 
   cat: /tmp/foo.sql: Permission denied
   ```
   
   However, the code on this branch generates no error and instead drops into the interactive REPL loop
   
   ```
   (arrow_dev) alamb@ip-10-0-0-124:~/Software/arrow-datafusion$ ./target/debug/datafusion-cli --file=/tmp/foo.sql
   > 
   
   ```
   




-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on a change in pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834019272


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#285](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e26e996) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/a947f11a8c0558c7301931a6c35a07de396d2463?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a947f11) will **decrease** coverage by `0.09%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/285/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #285      +/-   ##
   ==========================================
   - Coverage   76.16%   76.07%   -0.10%     
   ==========================================
     Files         140      140              
     Lines       23603    23632      +29     
   ==========================================
     Hits        17978    17978              
   - Misses       5625     5654      +29     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion-cli/src/main.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/285/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi1jbGkvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [a947f11...e26e996](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
Jimexist commented on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834020060






-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834019272


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#285](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (26361b0) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/b8805d4f44d4da8f16069d93ab342dc6f082ca07?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b8805d4) will **decrease** coverage by `0.11%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/285/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #285      +/-   ##
   ==========================================
   - Coverage   76.19%   76.07%   -0.12%     
   ==========================================
     Files         140      140              
     Lines       23595    23631      +36     
   ==========================================
     Hits        17978    17978              
   - Misses       5617     5653      +36     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion-cli/src/main.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/285/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi1jbGkvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b8805d4...26361b0](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
Jimexist edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834020094


   need to fix https://github.com/apache/arrow-datafusion/pull/284 first


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
Jimexist edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834020094


   ~need to fix https://github.com/apache/arrow-datafusion/pull/284 first~


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834019272


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#285](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ba9a0) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/9dface6c72fb812c7480571b1934288c80580a09?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9dface6) will **decrease** coverage by `0.11%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/285/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #285      +/-   ##
   ==========================================
   - Coverage   76.19%   76.07%   -0.12%     
   ==========================================
     Files         140      140              
     Lines       23595    23631      +36     
   ==========================================
     Hits        17978    17978              
   - Misses       5617     5653      +36     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion-cli/src/main.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/285/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi1jbGkvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [9dface6...24ba9a0](https://codecov.io/gh/apache/arrow-datafusion/pull/285?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist edited a comment on pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
Jimexist edited a comment on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-834020060


   ~need to fix https://github.com/apache/arrow-datafusion/pull/286 first~


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on a change in pull request #285: allow datafusion-cli to take file param

Posted by GitBox <gi...@apache.org>.
Jimexist commented on a change in pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#discussion_r628684608



##########
File path: datafusion-cli/src/main.rs
##########
@@ -65,16 +77,91 @@ 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) = matches
+        .value_of("file")
+        .and_then(|file| File::open(&file).ok())

Review comment:
       @alamb thanks for the comment, it's fixed now




-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb merged pull request #285: allow datafusion-cli to take a file param

Posted by GitBox <gi...@apache.org>.
alamb merged pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285


   


-- 
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:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on pull request #285: allow datafusion-cli to take a file param

Posted by GitBox <gi...@apache.org>.
alamb commented on pull request #285:
URL: https://github.com/apache/arrow-datafusion/pull/285#issuecomment-835254939


   Looks really good -- thanks @Jimexist 


-- 
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:
users@infra.apache.org