You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "collimarco (via GitHub)" <gi...@apache.org> on 2023/06/25 11:18:03 UTC

[GitHub] [arrow-datafusion] collimarco opened a new issue, #6763: Allow usage of datafusion-cli from other programs

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

   ### Is your feature request related to a problem or challenge?
   
   If we had these two options we could invoke `datafusion-cli` directly from other programs and languages:
   
   1. a `-command ` option to pass the SQL query directly as an argument on the command line
   2. a `-format` option to create an output that is machine readable, like CSV, JSON or Parquet
   
   Both options are supported for example by `psql` (Postgresql client) and it would be nice to have the same feature for `datafusion`. This would allow to invoke a standalone program (datafusion-cli) from other programs or from bash, for example to query a file using SQL.
   
   ### Describe the solution you'd like
   
   _No response_
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] r4ntix commented on issue #6763: Allow usage of datafusion-cli from other programs

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on issue #6763:
URL: https://github.com/apache/arrow-datafusion/issues/6763#issuecomment-1606425522

   @collimarco  it make sense to me, thanks for your suggestion. I am going to make a PR for this.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] collimarco commented on issue #6763: Allow usage of datafusion-cli from other programs

Posted by "collimarco (via GitHub)" <gi...@apache.org>.
collimarco commented on issue #6763:
URL: https://github.com/apache/arrow-datafusion/issues/6763#issuecomment-1606208883

   @r4ntix Wow, great.
   
   The only thing that is missing is the ability to **pass the SQL query directly as a command line argument**, instead of creating a file with the SQL. 
   
   That would be useful when you invoke the datafusion-cli from other programs and it would be similar to other databases (like the `-c` option of `psql`).


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #6763: Allow usage of datafusion-cli from other programs

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #6763: Allow usage of datafusion-cli from other programs
URL: https://github.com/apache/arrow-datafusion/issues/6763


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] r4ntix commented on issue #6763: Allow usage of datafusion-cli from other programs

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on issue #6763:
URL: https://github.com/apache/arrow-datafusion/issues/6763#issuecomment-1606108019

   The current datafusion-cli has the ability to execute sql file and format the output:
   ```shell
   $ echo 'show tables;' > sql.txt
   
   $ ./target/debug/datafusion-cli --file sql.txt --format json
   DataFusion CLI v26.0.0
   [{"table_catalog":"datafusion","table_name":"tables","table_schema":"information_schema","table_type":"VIEW"},{"table_catalog":"datafusion","table_name":"views","table_schema":"information_schema","table_type":"VIEW"},{"table_catalog":"datafusion","table_name":"columns","table_schema":"information_schema","table_type":"VIEW"},{"table_catalog":"datafusion","table_name":"df_settings","table_schema":"information_schema","table_type":"VIEW"}]
   4 rows in set. Query took 0.045 seconds.
   ```
   
   I don't know if this will work for you? 🤔️


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org