Periodically uploading to Clickhouse Pandas Dataframe

131 views
Skip to first unread message

Amanali Bekbolat

unread,
Feb 10, 2022, 7:37:37 AM2/10/22
to ClickHouse
Hi all! i have a pandas  Dataframe, are there any ways to upload it to clickhouse periodically? 

Thank you

Mayank Pant

unread,
Feb 10, 2022, 12:45:50 PM2/10/22
to ClickHouse
cron, executable table engine

Iman Rahmat XL

unread,
Feb 11, 2022, 7:44:30 AM2/11/22
to Amanali Bekbolat, ClickHouse
Dear Amanali,
The best way is like i found below

import pandahouse as ph

pdf = pandas.DataFrame.from_records([
{'year': 1994, 'first_name': 'Vova'},
{'year': 1995, 'first_name': 'Anja'},
{'year': 1996, 'first_name': 'Vasja'},
{'year': 1997, 'first_name': 'Petja'},
])

connection = dict(database='default',
host='localhost',
user='default',
password='')

ph.to_clickhouse(pdf, 'test_humans', index=False, chunksize=100000,
connection=connection)


Terima kasih,

Hormat Saya,
Iman Rahmat Hidayat.

Pada tanggal Kam, 10 Feb 2022 pukul 19.37 Amanali Bekbolat
<amanali....@nu.edu.kz> menulis:
>
> Hi all! i have a pandas Dataframe, are there any ways to upload it to clickhouse periodically?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups "ClickHouse" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clickhouse+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clickhouse/cd3a509a-54c5-4344-a447-dd050351e18dn%40googlegroups.com.
image.png
Reply all
Reply to author
Forward
0 new messages