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

[GitHub] [arrow-datafusion] spaydar opened a new pull request, #7362: DML documentation

spaydar opened a new pull request, #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362

   ## 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 #7319.
   
   ## 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.  
   -->
   
   ## 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 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)?
   -->
   
   Yes, I can successfully build and view documentation locally as per ["Build & Preview" instructions](https://github.com/apache/arrow-datafusion/blob/main/docs/README.md#build--preview)
   
   ## 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] Dandandan commented on a diff in pull request #7362: DML documentation

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#discussion_r1302125394


##########
docs/source/user-guide/sql/dml.md:
##########
@@ -0,0 +1,60 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# DML
+
+## COPY
+
+Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+
+<pre>
+COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+
+where <i><b>option</i></b> can be one of:
+    FORMAT <i><b>format_name</i></b>
+    PER_THREAD_OUTPUT <i><b>boolean</i></b>
+    ROW_GROUP_SIZE <i><b>integer</i></b>
+    ROW_GROUP_LIMIT_BYTES <i><b>integer</i></b>
+</pre>
+
+```sql
+> COPY source_table TO 'table' (FORMAT parquet, PER_THREAD_OUTPUT true);
++-------+
+| count |
++-------+
+| 2     |
++-------+
+```
+
+## INSERT
+
+Insert values into a table.
+
+<pre>
+INSERT INTO <i><b>table_name</i></b> { VALUES ( <i><b>expression</i></b> [, ...] ) [, ...] | <i><b>query</i></b> }
+</pre>
+
+```sql
+> INSERT INTO source_table VALUES (1, 'Foo'), (2, 'Bar');

Review Comment:
   ```suggestion
   > INSERT INTO target_table VALUES (1, 'Foo'), (2, 'Bar');
   ```



-- 
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 #7362: DML documentation

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#issuecomment-1690386400

   I noticed we didn't have docs for `COPY (SELECT ...)` so I propose extending these docs in 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


[GitHub] [arrow-datafusion] spaydar commented on a diff in pull request #7362: DML documentation

Posted by "spaydar (via GitHub)" <gi...@apache.org>.
spaydar commented on code in PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#discussion_r1302497654


##########
docs/source/user-guide/sql/dml.md:
##########
@@ -0,0 +1,60 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# DML
+
+## COPY
+
+Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+
+<pre>
+COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+
+where <i><b>option</i></b> can be one of:
+    FORMAT <i><b>format_name</i></b>

Review Comment:
   Supported formats are already specified on line 24.



-- 
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] Dandandan commented on a diff in pull request #7362: DML documentation

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#discussion_r1302124087


##########
docs/source/user-guide/sql/dml.md:
##########
@@ -0,0 +1,60 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# DML
+
+## COPY
+
+Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+
+<pre>
+COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+
+where <i><b>option</i></b> can be one of:
+    FORMAT <i><b>format_name</i></b>
+    PER_THREAD_OUTPUT <i><b>boolean</i></b>
+    ROW_GROUP_SIZE <i><b>integer</i></b>
+    ROW_GROUP_LIMIT_BYTES <i><b>integer</i></b>
+</pre>
+
+```sql
+> COPY source_table TO 'table' (FORMAT parquet, PER_THREAD_OUTPUT true);

Review Comment:
   ```suggestion
   > COPY source_table TO 'filename.parquet' (FORMAT PARQUET, PER_THREAD_OUTPUT TRUE);
   ```



-- 
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] Dandandan commented on a diff in pull request #7362: DML documentation

Posted by "Dandandan (via GitHub)" <gi...@apache.org>.
Dandandan commented on code in PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#discussion_r1302124882


##########
docs/source/user-guide/sql/dml.md:
##########
@@ -0,0 +1,60 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# DML
+
+## COPY
+
+Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+
+<pre>
+COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+
+where <i><b>option</i></b> can be one of:
+    FORMAT <i><b>format_name</i></b>

Review Comment:
   Can we add the supported formats as well?



-- 
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 #7362: DML documentation

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362


-- 
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 #7362: DML documentation

Posted by "spaydar (via GitHub)" <gi...@apache.org>.
spaydar commented on code in PR #7362:
URL: https://github.com/apache/arrow-datafusion/pull/7362#discussion_r1302501616


##########
docs/source/user-guide/sql/dml.md:
##########
@@ -0,0 +1,60 @@
+<!---
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+# DML
+
+## COPY
+
+Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`.
+
+<pre>
+COPY <i><b>table_name</i></b> TO '<i><b>file_name</i></b>' [ ( <i><b>option</i></b> [, ... ] ) ]
+
+where <i><b>option</i></b> can be one of:
+    FORMAT <i><b>format_name</i></b>
+    PER_THREAD_OUTPUT <i><b>boolean</i></b>
+    ROW_GROUP_SIZE <i><b>integer</i></b>
+    ROW_GROUP_LIMIT_BYTES <i><b>integer</i></b>
+</pre>
+
+```sql
+> COPY source_table TO 'table' (FORMAT parquet, PER_THREAD_OUTPUT true);

Review Comment:
   I added [an explanation and another example](https://github.com/apache/arrow-datafusion/pull/7362/commits/487ffbf4d6e9e39990e1d187ac7605441a743fc7) to clarify when one should specify a file name or a directory name.



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