diff --git a/docs/source/user-guide/sql/dml.md b/docs/source/user-guide/sql/dml.md new file mode 100644 index 0000000000000..26f291c15a121 --- /dev/null +++ b/docs/source/user-guide/sql/dml.md @@ -0,0 +1,69 @@ + + +# DML + +## COPY + +Copy a table to file(s). Supported file formats are `parquet`, `csv`, and `json`. + +The `PER_THREAD_OUTPUT` option treats `file_name` as a directory and writes a file per thread within it. + +
+COPY table_name TO 'file_name' [ ( option [, ... ] ) ]
+
+where option can be one of:
+    FORMAT format_name
+    PER_THREAD_OUTPUT boolean
+    ROW_GROUP_SIZE integer
+    ROW_GROUP_LIMIT_BYTES integer
+
+ +```sql +> COPY source_table TO 'file_name.json'; ++-------+ +| count | ++-------+ +| 2 | ++-------+ + +> COPY source_table TO 'dir_name' (FORMAT parquet, PER_THREAD_OUTPUT true); ++-------+ +| count | ++-------+ +| 2 | ++-------+ +``` + +## INSERT + +Insert values into a table. + +
+INSERT INTO table_name { VALUES ( expression [, ...] ) [, ...] | query }
+
+ +```sql +> INSERT INTO target_table VALUES (1, 'Foo'), (2, 'Bar'); ++-------+ +| count | ++-------+ +| 2 | ++-------+ +``` diff --git a/docs/source/user-guide/sql/index.rst b/docs/source/user-guide/sql/index.rst index 00fd20c7b70ad..b282fbddd6ca0 100644 --- a/docs/source/user-guide/sql/index.rst +++ b/docs/source/user-guide/sql/index.rst @@ -25,6 +25,7 @@ SQL Reference select subqueries ddl + dml explain information_schema operators