+1 vote
1 view
Hi,

I've tried this three different ways and it doesn't seem to want to let me upload a file to MyDB.

The file is a simple two-column CSV with a proper header and comma-separated values:
```
IRASPSC,TMASS_Designation
00254-3317,00275566-3300257
00428+6854,00460012+6910533
00439+1512,00463294+1528320
01037+1219,01062598+1235530
```

I first tried using the Data Explorer. When I try to upload the file, it says "Unable to process upload. Verify that the csv headers are present and that they match the table schema (for existing tables)". This wasn't an existing table, I just created a new name and started the upload.

I then tried using the command line, and after logging in and checking that I am logged in using `whoAmI`, I used `mydb_create` to create a schema and then tried to `mydb_insert` the table, but I get the response `schema "mydb" does not exist`.

Finally, I tried using the Jupyter notebook option online and retried the `mydb_create` and `mydb_insert`, and met with the same error (it says "OK" when I try `mydb_create`, and then fails to `insert`). The only thing I'm able to do with the notebook is to upload the table to VOSpace. However, when I try to copy it over from VOSpace to MyDB, I get the same error.
by sundarjhu (130 points) | 1 view
Hello and thank you for reaching out. The data provided looks fine. How big is the file you are trying to import into MyDB? It is possible that you are exceeding the upload limit. Also, one other thing to check is if you have a newline at the end of the CSV file. Although unconventional, a newline at the end of the file can also cause problems with the import.

If you need further assistance can you please email our support email directly at datalab@noirlab.edu and if feasible include a copy of the file?
Thanks for your response. The full file has 740 lines and is about 20 kB. I don't see a newline at the end of the file. I also cropped it to the first ten lines and just tried uploading again, but encountered the same error.
It sounds like the file you are using is valid. What is the name of the table you are trying to create?
It's of the form `data_2mass.csv` I haven't tried it without the underscore, if you think that might be the problem :)
I think the file name is fine, but what are you setting as the table name? In the Data Explorer, you attach your CSV file but also enter the name of the table. It isn't readily apparent but the table name needs to consist of only lowercase letters, numbers and underscores. If you are in fact using `data_2mass.csv` as the table name that could be part of the problem.

By the way, if you are using the client there is a `mydb_import` method that will create the table and import the data. You may prefer this option instead of the `mydb_create` and `mydb_insert` methods.
Yes, I was initially using uppercase letters in my table name, but a look through some examples later I stuck to names like `data_2mass` (no .csv).

I also did try `mydb_import` from the client as well as the notebook. Same issue. No complaints when I call `mydb_create`, but if I try to list tables in `mydb` after that, it's empty. If I then try to `mydb_insert`, it throws an error.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

521 questions

529 answers

512 comments

699 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories