pandahouse icon indicating copy to clipboard operation
pandahouse copied to clipboard

Create table from dataframe?

Open EgorKraevTransferwise opened this issue 4 years ago • 5 comments

Is there a way to automatically create a table matching the column types of a dataframe, similar to pandas.DataFrame.to_sql()?

EgorKraevTransferwise avatar Nov 19 '20 19:11 EgorKraevTransferwise

i can see that there's no such function currently. but is this feature welcomed? can I send a PR if I managed to implement it? @kszucs

timfeirg avatar Mar 29 '21 09:03 timfeirg

Definitely!

kszucs avatar Mar 29 '21 10:03 kszucs

@timfeirg is it done?

9en9i avatar Mar 30 '21 19:03 9en9i

there's this package https://github.com/cloudflare/sqlalchemy-clickhouse that already can generate create table statements, I've tried but it is clearly not finished yet, but we're better off improving things in that repo, because pandas already supports sqlalchemy.

timfeirg avatar Apr 06 '21 08:04 timfeirg

Note that this package will switch to use columnar output formats in the future, once clickhouse extends its type support for these formats, see https://github.com/kszucs/pandahouse/issues/29 for reference.

kszucs avatar Apr 06 '21 09:04 kszucs