Skip to content

Commit e86cdcc

Browse files
committed
chore: add document example
1. add document example in docs/doc/21-load-data/01-s3.md 2. fixes unit tests Signed-off-by: ClSlaid <cailue@bupt.edu.cn>
1 parent be22db6 commit e86cdcc

File tree

4 files changed

+104
-100
lines changed

4 files changed

+104
-100
lines changed

docs/doc/21-load-data/01-s3.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ To use the COPY data loading, you will need the following information:
8282
* Your AWS account’s access keys, such as:
8383
* Access Key ID: *your-access-key-id*
8484
* Secret Access Key: *your-secret-access-key*
85-
85+
* Security Token (Optional): *your-aws-temporary-access-token*
8686

8787
### Step 5: Copy Data into the Target Tables
8888

@@ -95,7 +95,7 @@ Using this URI and keys, execute the following statement, replacing the placehol
9595
```sql
9696
COPY INTO books
9797
FROM 's3://databend-bohu/data/'
98-
credentials=(aws_key_id='<your-access-key-id>' aws_secret_key='<your-secret-access-key>')
98+
credentials=(aws_key_id='<your-access-key-id>' aws_secret_key='<your-secret-access-key>' [aws-token='<your-aws-temporary-access-token>'])
9999
pattern ='.*[.]csv'
100100
file_format = (type = 'CSV' field_delimiter = ',' record_delimiter = '\n' skip_header = 0);
101101
```

src/query/service/tests/it/configs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ region = ""
117117
endpoint_url = "https://s3.amazonaws.com"
118118
access_key_id = ""
119119
secret_access_key = ""
120+
security_token = ""
120121
bucket = ""
121122
root = ""
122123
master_key = ""

src/query/service/tests/it/interpreters/interpreter_user_stage.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ async fn test_user_stage_interpreter() -> Result<()> {
5151

5252
common_datablocks::assert_blocks_eq(
5353
vec![
54-
"+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
55-
"| name | stage_type | stage_params | copy_options | file_format_options | number_of_files | creator | comment |",
56-
"+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
57-
"| test_stage | External | StageParams { storage: S3(StorageS3Config { endpoint_url: \"https://s3.amazonaws.com\", region: \"\", bucket: \"load\", root: \"/files/\", disable_credential_loader: true, enable_virtual_host_style: false, access_key_id: \"******b3c\", secret_access_key: \"******y6z\", master_key: \"\" }) } | CopyOptions { on_error: None, size_limit: 0, purge: false } | FileFormatOptions { format: Csv, skip_header: 0, field_delimiter: \",\", record_delimiter: \"\\n\", compression: None } | NULL | 'root'@'127.0.0.1' | |",
58-
"+------------+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
54+
"+------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
55+
"| name | stage_type | stage_params | copy_options | file_format_options | number_of_files | creator | comment |",
56+
"+------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
57+
"| test_stage | External | StageParams { storage: S3(StorageS3Config { endpoint_url: \"https://s3.amazonaws.com\", region: \"\", bucket: \"load\", root: \"/files/\", disable_credential_loader: true, enable_virtual_host_style: false, access_key_id: \"******b3c\", secret_access_key: \"******y6z\", security_token: \"\", master_key: \"\" }) } | CopyOptions { on_error: None, size_limit: 0, purge: false } | FileFormatOptions { format: Csv, skip_header: 0, field_delimiter: \",\", record_delimiter: \"\\n\", compression: None } | NULL | 'root'@'127.0.0.1' | |",
58+
"+------------+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+-----------------+--------------------+---------+",
5959
],
6060
&blocks,
6161
);

0 commit comments

Comments
 (0)