Skip to content

Commit

Permalink
docs: note about pattern in copy. (databendlabs#12951)
Browse files Browse the repository at this point in the history
* docs: note about pattern in copy.

* Update dml-copy-into-table.md

---------

Co-authored-by: BohuTANG <overred.shuttler@gmail.com>
  • Loading branch information
2 people authored and andylokandy committed Nov 27, 2023
1 parent 2fd191d commit 5dc94c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/doc/14-sql-commands/10-dml/dml-copy-into-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,14 @@ externalLocation ::=

Specify a list of one or more files names (separated by commas) to be loaded.

### PATTERN = 'regex_pattern'
### PATTERN = '<regex_pattern>'

A [PCRE2](https://www.pcre.org/current/doc/html/)-based regular expression pattern string, enclosed in single quotes, specifying the file names to match. Click [here](#loading-data-with-pattern-matching) to see an example. For PCRE2 syntax, see http://www.pcre.org/current/doc/html/pcre2syntax.html.

:::note
Suppose there is a file `@<stage_name>/<path>/<sub_path>`, to include it, `<sub_path>` needs to match `^<regex_pattern>$`.
:::

### FILE_FORMAT

See [Input & Output File Formats](../../13-sql-reference/50-file-format-options.md).
Expand Down
7 changes: 6 additions & 1 deletion docs/doc/15-sql-functions/112-table-functions/list_stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ externalStage ::= @<external_stage_name>[/<path>]
userStage ::= @~[/<path>]
```

### PATTERN

See [COPY INTO table](/14-sql-commands/10-dml/dml-copy-into-table.md).


## Examples

```sql
SELECT * FROM list_stage(location => '@my_stage/', pattern => '.log');
SELECT * FROM list_stage(location => '@my_stage/', pattern => '.*[.]log');
+----------------+------+------------------------------------+-------------------------------+---------+
| name | size | md5 | last_modified | creator |
+----------------+------+------------------------------------+-------------------------------+---------+
Expand Down

0 comments on commit 5dc94c7

Please sign in to comment.