Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions sql-statements/sql-statement-load-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ LoadDataStmt ::=

LocalOpt ::= ('LOCAL')?

DuplicateOpt ::=
( 'IGNORE' | 'REPLACE' )?

Fields ::=
('TERMINATED' 'BY' stringLit
| ('OPTIONALLY')? 'ENCLOSED' 'BY' stringLit
Expand Down Expand Up @@ -59,6 +62,15 @@ If you are using TiDB Cloud, to use the `LOAD DATA` statement to load local data
mysql --connect-timeout 15 --ssl-mode=VERIFY_IDENTITY --ssl-ca=<CA_path> --tls-version="TLSv1.2" -u root -h <host_name> -P 4000 -D test -p<your_password> --local-infile
```

### `REPLACE` and `IGNORE`

You can use `REPLACE` and `IGNORE` to specify how duplicate data is handled.

- `REPLACE`: existing data is overwritten.
- `IGNORE`: duplicate rows are ignored, keeping existing data.

By default, duplicate data leads to errors.

### S3 and GCS storage

<CustomContent platform="tidb">
Expand Down
Loading