Skip to content

Commit 225aac3

Browse files
committed
Update s3-external.md to show GCS example
1 parent 03ac7b1 commit 225aac3

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

docs/s3-external.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ SETTINGS type='s3',
9494
data_format='RawBLOB';
9595
```
9696

97+
#### Read from a GCS bucket
98+
To read data from Google Cloud Storage, please follow [the guide](https://cloud.google.com/storage/docs/authentication/hmackeys) to generate HMAC keys and use them as the access key and secret key. You don't need to set the `region` or `bucket`. Put those information in the `endpoint` setting.
99+
```sql
100+
CREATE EXTERNAL TABLE nyc_fhvhv(
101+
`hvfhs_license_num` nullable (string),
102+
`dispatching_base_num` nullable (string),
103+
..
104+
)
105+
SETTINGS type='s3',
106+
endpoint = 'https://storage.googleapis.com/timeplus-nyc-tlc',
107+
access_key_id = 'GOOG..', --HMAC access ID
108+
secret_access_key = '..', --HMAC secret key
109+
read_from = 'fhvhv_tripdata_2025-02.parquet';
110+
```
111+
97112
### DDL Settings
98113

99114
#### type
@@ -122,15 +137,15 @@ The `config_file` setting is available since Timeplus Enterprise 2.7. You can sp
122137
Please follow the example in [Kafka External Stream](/proton-kafka#config_file).
123138

124139
#### region
125-
The region where the S3 bucket is located, such as `us-west-1`.
140+
The region where the S3 bucket is located, such as `us-west-1`. Optional for GCS.
126141

127142
#### bucket
128-
The name of the S3 bucket.
143+
The name of the S3 bucket. Optional for GCS.
129144

130145
#### endpoint
131146
The endpoint of the S3-compatible object storage system. It's optional. If it's missing, Timeplus will use the default endpoint for the region.
132147

133-
For example, if you have a minio running locally using the default ports. Then you should use `endpoint = 'http://localhost:9000'` to connect to the minio service.
148+
For example, if you have a minio running locally using the default ports. Then you should use `endpoint = 'http://localhost:9000'` to connect to the minio service. If you are connecting to Google Cloud Storage, set the endpoint to `'https://storage.googleapis.com/<bucket_name>'`.
134149

135150
#### data_format
136151
The `data_format` is optional. When it's missing, Timeplus will try to infer the data format from the file extension in `read_from` or `write_to`.

0 commit comments

Comments
 (0)