-
Notifications
You must be signed in to change notification settings - Fork 761
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: list_stage table function. (#12175)
* docs: list_stage table function. * updates --------- Co-authored-by: soyeric128 <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
87f7df3
commit ec26e8d
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
docs/doc/15-sql-functions/112-table-functions/list_stage.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: LIST_STAGE | ||
--- | ||
import FunctionDescription from '@site/src/components/FunctionDescription'; | ||
|
||
<FunctionDescription description="Introduced: v1.2.32"/> | ||
|
||
Lists files in a stage. This allows you to filter files in a stage based on their extensions and obtain comprehensive details about each file. The function is similar to the DDL command [LIST STAGE FILES](../../14-sql-commands/00-ddl/40-stage/04-ddl-list-stage.md), but but provides you the flexibility to retrieve specific file information with the SELECT statement, such as file name, size, MD5 hash, last modified timestamp, and creator, rather than all file information. | ||
|
||
## Syntax | ||
|
||
```sql | ||
LIST_STAGE( | ||
LOCATION => '{ internalStage | externalStage }' | ||
[ PATTERN => '<regex_pattern>'] | ||
) | ||
``` | ||
|
||
Where: | ||
|
||
### internalStage | ||
|
||
```sql | ||
internalStage ::= @<internal_stage_name>[/<path>] | ||
``` | ||
|
||
### externalStage | ||
|
||
```sql | ||
externalStage ::= @<external_stage_name>[/<path>] | ||
``` | ||
|
||
### userStage | ||
|
||
```sql | ||
userStage ::= @~[/<path>] | ||
``` | ||
|
||
## Examples | ||
|
||
```sql | ||
SELECT * FROM list_stage(location => '@my_stage/', pattern => '.log'); | ||
+----------------+------+------------------------------------+-------------------------------+---------+ | ||
| name | size | md5 | last_modified | creator | | ||
+----------------+------+------------------------------------+-------------------------------+---------+ | ||
| 2023/meta.log | 475 | "4208ff530b252236e14b3cd797abdfbd" | 2023-04-19 20:23:24.000 +0000 | NULL | | ||
| 2023/query.log | 1348 | "1c6654b207472c277fc8c6207c035e18" | 2023-04-19 20:23:24.000 +0000 | NULL | | ||
+----------------+------+------------------------------------+-------------------------------+---------+ | ||
|
||
-- Equivalent to the following statement: | ||
LIST @my_stage PATTERN = '.log'; | ||
``` |
ec26e8d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
databend – ./
databend-git-main-databend.vercel.app
databend-databend.vercel.app
databend.vercel.app
databend.rs