blaze / odo

Data Migration for the Blaze Project
http://odo.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
1k stars 138 forks source link

pandas.Dataframe to mysql Table with auto_increment #608

Closed JoooyZ closed 6 years ago

JoooyZ commented 6 years ago

Hi, I try to use odo to convert large df data to mysql Table, include a auto_increment id and two foreign keys, but failed. I got the error: ValueError: Column names of incoming data don't match column names of existing SQL table Names in SQL table: ['id', 'domain','count', 'client_ip_id', 'uuid_id', 'start_time'] Names from incoming data: ['client_ip_id', 'count', 'domain', 'uuid_id', 'start_time']

And my code is simply like this: odo.odo(source=df, target="mysql://username:pswd@remote_server:port/db_name::table_name")

How should I fix it?

jingyu-xu commented 6 years ago

I got the same error. ValueError: Column names of incoming data don't match column names of existing SQL table Names in SQL table: ['id', 'variable_code', 'zcta', 'value', 'Year'] Names from incoming data: ['variable_code', 'zcta', 'value', 'Year']

JeromeRaghunandan commented 5 years ago

I have the same error. How do you handle auto incrementing identity columns with odo?