Skip to content

Commit b30a4a1

Browse files
authored
Merge pull request #10569 from soyeric128/creat-stage
docs: create stagee
2 parents 7e320d7 + af64423 commit b30a4a1

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

docs/doc/14-sql-commands/00-ddl/40-stage/01-ddl-create-stage.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: CREATE STAGE
33
---
44

5-
Creates a stage.
5+
Creates an internal or external stage.
66

77
## Syntax
88

@@ -21,16 +21,18 @@ CREATE STAGE [ IF NOT EXISTS ] <external_stage_name>
2121
[ COMMENT = '<string_literal>' ]
2222
```
2323

24-
Where:
25-
2624
### externalStageParams
2725

26+
:::note
27+
If the `ENDPOINT_URL` parameter is not specified in the command, Databend will create the stage on Amazon S3 by default. Therefore, when you create an external stage on an S3-compatible object storage or other object storage solutions, be sure to include the `ENDPOINT_URL` parameter.
28+
:::
29+
2830
import Tabs from '@theme/Tabs';
2931
import TabItem from '@theme/TabItem';
3032

3133
<Tabs groupId="externalstageparams">
3234

33-
<TabItem value="Amazon S3-compatible Storage" label="Amazon S3-compatible Storage">
35+
<TabItem value="Amazon S3-compatible Storage" label="Amazon S3-compatible">
3436

3537
```sql
3638
externalStageParams ::=
@@ -46,7 +48,7 @@ externalStageParams ::=
4648

4749
| Parameter | Description | Required |
4850
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
49-
| URL | External files located at the AWS S3 compatible object storage. | **Required** |
51+
| URL | External files located at the AWS S3 compatible object storage. | Required |
5052
| ENDPOINT_URL | The bucket endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Optional |
5153
| ACCESS_KEY_ID | Your access key ID for connecting the AWS S3 compatible object storage. If not provided, Databend will access the bucket anonymously. | Optional |
5254
| SECRET_ACCESS_KEY | Your secret access key for connecting the AWS S3 compatible object storage. | Optional |
@@ -55,7 +57,7 @@ externalStageParams ::=
5557

5658
</TabItem>
5759

58-
<TabItem value="Azure Blob Storage" label="Azure Blob Storage">
60+
<TabItem value="Azure Blob Storage" label="Azure Blob">
5961

6062
```sql
6163
externalStageParams ::=
@@ -69,14 +71,14 @@ externalStageParams ::=
6971

7072
| Parameter | Description | Required |
7173
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
72-
| URL | External files located at the Azure Blob storage. | **Required** |
73-
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Optional |
74+
| URL | External files located at the Azure Blob storage. | Required |
75+
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Required |
7476
| ACCOUNT_NAME | Your account name for connecting the Azure Blob storage. If not provided, Databend will access the container anonymously. | Optional |
7577
| ACCOUNT_KEY | Your account key for connecting the Azure Blob storage. | Optional |
7678

7779
</TabItem>
7880

79-
<TabItem value="Google Cloud Storage" label="Google Cloud Storage">
81+
<TabItem value="Google Cloud Storage" label="Google Cloud">
8082

8183
```sql
8284
externalLocation ::=
@@ -89,13 +91,13 @@ externalLocation ::=
8991

9092
| Parameter | Description | Required |
9193
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
92-
| URL | External files located at the Google Cloud Storage | **Required** |
93-
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Optional |
94+
| URL | External files located at the Google Cloud Storage | Required |
95+
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Required |
9496
| CREDENTIAL | Your credential for connecting the GCS. If not provided, Databend will access the container anonymously. | Optional |
9597

9698
</TabItem>
9799

98-
<TabItem value="Huawei Object Storage" label="Huawei Object Storage">
100+
<TabItem value="Huawei Object Storage" label="Huawei OBS">
99101

100102
```sql
101103
externalLocation ::=
@@ -109,14 +111,14 @@ externalLocation ::=
109111

110112
| Parameter | Description | Required |
111113
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
112-
| URL | External files located at the obs | **Required** |
113-
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | **Required** |
114+
| URL | External files located at the obs | Required |
115+
| ENDPOINT_URL | The container endpoint URL starting with "https://". To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Required |
114116
| ACCESS_KEY_ID | Your access key ID for connecting the OBS. If not provided, Databend will access the bucket anonymously. | Optional |
115117
| SECRET_ACCESS_KEY | Your secret access key for connecting the OBS. | Optional |
116118

117119
</TabItem>
118120

119-
<TabItem value="WebHDFS Storage" label="WebHDFS Storage">
121+
<TabItem value="WebHDFS Storage" label="WebHDFS">
120122

121123
```sql
122124
externalLocation ::=
@@ -129,7 +131,7 @@ externalLocation ::=
129131

130132
| Parameter | Description | Required |
131133
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
132-
| URL | External endpoint and location of files. | **Required** |
134+
| URL | External endpoint and location of files. | Required |
133135
| HTTPS | Connect to RESTful API with HTTP or HTTPS, set to `true` will use `HTTPS`, else `HTTP`. Use `HTTPS` by default. To use a URL starting with "http://", set `allow_insecure` to `true` in the [storage] block of the file `databend-query-node.toml`. | Optional |
134136
| DELEGATION | Delegation token of WebHDFS for authentication. If not set, no tokens will be used in further operations. | Optional |
135137

@@ -156,19 +158,13 @@ copyOptions ::=
156158

157159
## Examples
158160

159-
### Internal Stages
160-
161161
```sql
162+
-- This example creates an internal stage.
162163
CREATE STAGE my_internal_stage;
163-
```
164164

165-
### External Stages
166-
167-
```sql
165+
-- This example creates an external stage on Amazon S3.
168166
CREATE STAGE my_s3_stage URL='s3://load/files/' CONNECTION = (ACCESS_KEY_ID = '<your-access-key-id>' SECRET_ACCESS_KEY = '<your-secret-access-key>');
169-
```
170167

171-
```sql
172168
DESC STAGE my_s3_stage;
173169
+-------------+------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------+---------+
174170
| name | stage_type | stage_params | copy_options | file_format_options | comment |

0 commit comments

Comments
 (0)