Skip to content

Commit 157ea94

Browse files
authored
tidb-cloud: update LOAD DATA INFILE description (#20917) (#20919)
1 parent d346793 commit 157ea94

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

sql-statements/sql-statement-load-data.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ Starting from TiDB v7.0.0, the `LOAD DATA` SQL statement supports the following
1717
>
1818
> The new parameter `FIELDS DEFINED NULL BY` and support for importing data from S3 and GCS are experimental. It is not recommended that you use it in the production environment. This feature might be changed or removed without prior notice. If you find a bug, you can report an [issue](https://github.com/pingcap/tidb/issues) on GitHub.
1919
20+
<CustomContent platform="tidb-cloud">
21+
22+
> **Note:**
23+
>
24+
> For the `LOAD DATA INFILE` statement, TiDB Cloud Dedicated supports `LOAD DATA LOCAL INFILE`, and `LOAD DATA INFILE` from Amazon S3 or Google Cloud Storage, while TiDB Cloud Serverless only supports `LOAD DATA LOCAL INFILE`.
25+
26+
</CustomContent>
27+
2028
## Synopsis
2129

2230
```ebnf+diagram
@@ -145,6 +153,21 @@ LOAD DATA LOCAL INFILE '/mnt/evo970/data-sets/bikeshare-data/2017Q4-capitalbikes
145153

146154
In the above example, `x'2c'` is the hexadecimal representation of the `,` character, and `b'100010'` is the binary representation of the `"` character.
147155

156+
<CustomContent platform="tidb-cloud">
157+
158+
The following example shows how to import data into a TiDB Cloud Dedicated cluster from Amazon S3 using the `LOAD DATA INFILE` statement:
159+
160+
```sql
161+
LOAD DATA INFILE 's3://<your-bucket-name>/your-file.csv?role_arn=arn:aws:iam::<your-account-id>:role/<your-role-name>&external_id=<your-external-id>'
162+
INTO TABLE <your-db-name>.<your-table-name>
163+
FIELDS TERMINATED BY ','
164+
ENCLOSED BY '"'
165+
LINES TERMINATED BY '\n'
166+
IGNORE 1 LINES;
167+
```
168+
169+
</CustomContent>
170+
148171
## MySQL compatibility
149172

150173
The syntax of the `LOAD DATA` statement is compatible with that of MySQL, except for character set options which are parsed but ignored. If you find any syntax compatibility difference, you can [report a bug](https://docs.pingcap.com/tidb/stable/support).

tidb-cloud/limited-sql-features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ TiDB Cloud works with almost all workloads that TiDB supports, but there are som
4646
| `ADMIN PLUGINS ENABLE` | Supported | Not supported [^8] |
4747
| `ADMIN PLUGINS DISABLE` | Supported | Not supported [^8] |
4848
| `ALTER INSTANCE RELOAD TLS` | Supported | TiDB Cloud Serverless automatically refreshes the TLS certificate. |
49-
| `LOAD DATA INFILE` | Only supports `LOAD DATA LOCAL INFILE` | Only supports `LOAD DATA LOCAL INFILE` |
49+
| `LOAD DATA INFILE` | Supports `LOAD DATA LOCAL INFILE`, and `LOAD DATA INFILE` from Amazon S3 or Google Cloud Storage | Only supports `LOAD DATA LOCAL INFILE` |
5050
| `CHANGE DRAINER` | Not supported [^7] | Not supported [^7] |
5151
| `CHANGE PUMP` | Not supported [^7] | Not supported [^7] |
5252
| `FLASHBACK CLUSTER` | Supported | Not supported [^3] |

0 commit comments

Comments
 (0)