chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://clickhouse.com/docs/en/chdb
Apache License 2.0
2.03k stars 72 forks source link

Date type transformed to uint16 when export to Dataframe #88

Open blackrez opened 1 year ago

blackrez commented 1 year ago

Describe the issue When a query retuns Date type and it is exported to Dataframe or Arrow, it will be transformed to

How to reproduce

res = chdb.query('SELECT toDate(now())', 'Dataframe')
res
>>>toDate(now())
>>>0          19585

res = chdb.query('SELECT toDate32(now())', 'Dataframe')
res
>>>toDate32(now())
>>>0      2023-08-16
Daniel-Robbins commented 8 months ago

I will try to fix this. It seems to be a clickhouse arrow format issue: https://clickhouse.com/docs/en/interfaces/formats#data-types-matching-arrow I will find out why is this:

image