Skip to content

Commit

Permalink
Update Docs with Copy partition_by support (#9275)
Browse files Browse the repository at this point in the history
* update copy docs

* prettier
  • Loading branch information
devinjdangelo committed Feb 21, 2024
1 parent 202f285 commit 89ee9b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions docs/source/user-guide/sql/dml.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ files in the `dir_name` directory:
+-------+
```

Copy the contents of `source_table` to multiple directories
of hive-style partitioned parquet files:

```sql
> COPY source_table TO 'dir_name' (FORMAT parquet, partition_by 'column1, column2');
+-------+
| count |
+-------+
| 2 |
+-------+
```

Run the query `SELECT * from source ORDER BY time` and write the
results (maintaining the order) to a parquet file named
`output.parquet` with a maximum parquet row group size of 10MB:
Expand Down
8 changes: 5 additions & 3 deletions docs/source/user-guide/sql/write_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ TO 'test/table_with_options'
(format parquet,
compression snappy,
'compression::col1' 'zstd(5)',
partition_by 'column3, column4'
)
```

Expand All @@ -67,9 +68,10 @@ In this example, we write the entirety of `source_table` out to a folder of parq

The following special options are specific to the `COPY` command.

| Option | Description | Default Value |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| FORMAT | Specifies the file format COPY query will write out. If there're more than one output file or the format cannot be inferred from the file extension, then FORMAT must be specified. | N/A |
| Option | Description | Default Value |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| FORMAT | Specifies the file format COPY query will write out. If there're more than one output file or the format cannot be inferred from the file extension, then FORMAT must be specified. | N/A |
| PARTITION_BY | Specifies the columns that the output files should be partitioned by into separate hive-style directories. Value should be a comma separated string literal, e.g. 'col1,col2' | N/A |

### JSON Format Specific Options

Expand Down

0 comments on commit 89ee9b0

Please sign in to comment.