Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not support DateTime64 and Map datatype #148

Closed
chenzi opened this issue Oct 13, 2021 · 2 comments · Fixed by #266
Closed

Not support DateTime64 and Map datatype #148

chenzi opened this issue Oct 13, 2021 · 2 comments · Fixed by #266

Comments

@chenzi
Copy link

chenzi commented Oct 13, 2021

see:

/root/clickhouse-sqlalchemy/lib64/python3.7/site-packages/clickhouse_sqlalchemy/drivers/base.py:919: SAWarning: Did not recognize type 'DateTime64(3, 'UTC')' of column 'ts'
(spec, name))
/root/clickhouse-sqlalchemy/lib64/python3.7/site-packages/clickhouse_sqlalchemy/drivers/base.py:919: SAWarning: Did not recognize type 'Map(String, String)' of column 'properties'
(spec, name))

@aadant
Copy link

aadant commented Oct 5, 2023

@subkanthi did you address DateTime64 ?

@subkanthi
Copy link
Contributor

aadant

Hi @aadant , datetime64 seems to work

class RateWithDate(Base):
   day = Column(types.DateTime64, primary_key=True)
   value = Column(types.Int32)

   __table_args__ = (
               engines.Memory(),
           )

RateWithDate.__table__.create()

rate_with_date = [ {'day': '1900-01-01 00:00:00', 'value': 1},
                     {'day': '2299-12-31 23:59:59.99999999', 'value': 2},
   ]
session.execute(RateWithDate.__table__.insert(rate_with_date))

session.execute(RateWithDate.__table__.update().where(RateWithDate.value == 1).values(day='2021-01-01 00:00:00'))

41626bbbf90c :) select * from rate_with_date;

SELECT *
FROM rate_with_date

Query id: 65715ebc-c685-4a03-8b3d-54792df0c73f

┌─────────────────────day─┬─value─┐
│ 2021-01-01 00:00:00.000 │     1 │
│ 2299-12-31 23:59:59.999 │     2 │
└─────────────────────────┴───────┘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants