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

Unsupported syntax: LOAD DATA ... IGNORE 1 ROWS #2548

Closed
Vectorial1024 opened this issue Jan 2, 2022 · 2 comments
Closed

Unsupported syntax: LOAD DATA ... IGNORE 1 ROWS #2548

Vectorial1024 opened this issue Jan 2, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Vectorial1024
Copy link

Vectorial1024 commented Jan 2, 2022

This does not seem obvious to me, but how do I import or upload data from csv files?

I have read from here https://www.dolthub.com/blog/2020-02-03-dolt-and-dolthub-getting-started/ about how to export data into csv, but I am stuck tring to import data from csv. While exploring how to import data from csv into dolt tables, I came across the blog here https://www.dolthub.com/blog/2020-02-03-dolt-and-dolthub-getting-started/

I tried the following:

dolt sql
db> LOAD DATA INFILE "./data.csv" INTO TABLE estate FIELDS TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n' IGNORE 1 ROWS;

But it always complain about SQL syntax errors:

syntax error at position [...] near 'ROWS'
[...] IGNORE 1 ROWS;
                    ^

Help is appreciated, thanks!

@Vectorial1024
Copy link
Author

Update: turns out this question is already answered by the blog here https://www.dolthub.com/blog/2020-04-29-dolt-dolthub-publish-csv/ . My bad for not exploring the existing documentations well enough.

Still, leaving this open in case the above error is needed to be fixed.

@Vectorial1024 Vectorial1024 changed the title Question: How to upload/import data from csv files? Question: syntax error when trying to use LOAD DATA? Or, wrong use of cmd? Jan 2, 2022
@VinaiRachakonda
Copy link
Contributor

@Vectorial1024 You have found a bug in our parsing of LOAD DATA queries. If you switch ROWS to LINES it should work as intended.

dolt table import is easiest way to get data into dolt

@zachmu zachmu changed the title Question: syntax error when trying to use LOAD DATA? Or, wrong use of cmd? Unsupported syntax: LOAD DATA ... IGNORE 1 ROWS Jan 6, 2022
@zachmu zachmu added the bug Something isn't working label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants