You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/08/23 17:49:58 UTC
[GitHub] [arrow-datafusion] alamb opened a new pull request, #7388: Docs: Add query syntax to COPY docs
alamb opened a new pull request, #7388:
URL: https://github.com/apache/arrow-datafusion/pull/7388
## 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.
-->
Part of https://github.com/apache/arrow-datafusion/issues/7319
## Rationale for this change
One thing I noticed while reviewing https://github.com/apache/arrow-datafusion/pull/7362 (thank you @spaydar !!) was that it didn't mention the `COPY (SELECT ...)` syntax, which is quite helpful for reordering input, for example.
## What changes are included in this PR?
Add note and example of using `COPY (SELECT ...)` and define what DDL/DML are
## Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
## 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 `api 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.
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] spaydar commented on a diff in pull request #7388: Docs: Add query syntax to `COPY` docs
Posted by "spaydar (via GitHub)" <gi...@apache.org>.
spaydar commented on code in PR #7388:
URL: https://github.com/apache/arrow-datafusion/pull/7388#discussion_r1303726607
##########
docs/source/user-guide/sql/ddl.md:
##########
@@ -19,6 +19,9 @@
# DDL
+DDL stands for "Data Definition Lanaguage" and relates to creating and
Review Comment:
```suggestion
DDL stands for "Data Definition Language" and relates to creating and
```
##########
docs/source/user-guide/sql/dml.md:
##########
@@ -19,14 +19,19 @@
# DML
+DML stands for "Data Manipulation Lanaguage" and relates to inserting
Review Comment:
```suggestion
DML stands for "Data Manipulation Language" and relates to inserting
```
##########
docs/source/user-guide/sql/dml.md:
##########
@@ -19,14 +19,19 @@
# DML
+DML stands for "Data Manipulation Lanaguage" and relates to inserting
+and modifying data in tables.
+
## COPY
-Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+Copies the contents of a table or query to file(s). Supported file
+formats are `parquet`, `csv`, and `json` and can be inferred based on
+filename if writing to a single file.
The `PER_THREAD_OUTPUT` option treats `file_name` as a directory and writes a file per thread within it.
<pre>
-COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+COPY [<i><b>table_name</i></b> | <i><b>query</i></b>] TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
Review Comment:
```suggestion
COPY { <i><b>table_name</i></b> | <i><b>query</i></b> } TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
```
changes "optional" syntax to "requires one of"
--
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 commented on pull request #7388: Docs: Add query syntax to `COPY` docs
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7388:
URL: https://github.com/apache/arrow-datafusion/pull/7388#issuecomment-1691700588
Thanks @spaydar for saving me (again) from silly typos
--
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 merged pull request #7388: Docs: Add query syntax to `COPY` docs
Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #7388:
URL: https://github.com/apache/arrow-datafusion/pull/7388
--
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