Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: LOAD DATA LOCAL INFILE does not support IGNORE LINES #7476

Closed
morgo opened this issue Aug 23, 2018 · 3 comments
Closed

Feature Request: LOAD DATA LOCAL INFILE does not support IGNORE LINES #7476

morgo opened this issue Aug 23, 2018 · 3 comments
Labels
type/enhancement The issue or PR belongs to an enhancement.

Comments

@morgo
Copy link
Contributor

morgo commented Aug 23, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    I tried to import a csv file, using instructions in the MySQL manual:
mysql> LOAD DATA LOCAL INFILE '2017Q1-capitalbikeshare-tripdata.csv' INTO TABLE trips
    ->   FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    ->   LINES TERMINATED BY '\r\n'
    -> IGNORE 1 LINES;
ERROR 1105 (HY000): line 4 column 7 near " 1 LINES" (total length 165)

Big data sets are often distributed as CSV, and in this case it had a header row which needs to be skipped.

  1. What did you expect to see?
    MySQL behavior:
mysql [localhost] {msandbox} (bikeshare) > LOAD DATA LOCAL INFILE '2017Q1-capitalbikeshare-tripdata.csv' INTO TABLE trips
    ->   FIELDS TERMINATED BY ',' ENCLOSED BY '"'
    ->   LINES TERMINATED BY '\r\n'
    -> IGNORE 1 LINES;

Query OK, 646510 rows affected (4.56 sec)
Records: 646510  Deleted: 0  Skipped: 0  Warnings: 0
  1. What did you see instead?

An error (the IGNORE 1 LINES syntax is not supported).

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-278-g1fa5669fb
Git Commit Hash: 1fa5669fb48ae0c6cf2d99413d62c7652f872c4e
Git Branch: master
UTC Build Time: 2018-08-23 07:38:51
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.01 sec)
@winoros winoros added the type/enhancement The issue or PR belongs to an enhancement. label Aug 24, 2018
@mccxj
Copy link
Contributor

mccxj commented Aug 27, 2018

I am going to do it, if no one is doing it?

@shenli
Copy link
Member

shenli commented Aug 27, 2018

@mccxj Great! You could assign this issue to yourself.

@morgo
Copy link
Contributor Author

morgo commented Sep 6, 2018

Fixed in #7576

@morgo morgo closed this as completed Sep 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

4 participants