Skip to content

Binary Engine DateTime64 Parsing Loses Precision #114

@theory

Description

@theory

Given a high-precision DateTime64, such as

SELECT toDateTime64('2025-12-05 11:51:04.390884', 6, 'UTC')

   ┌─toDateTime64(⋯', 6, 'UTC')─┐
1. │ 2025-12-05 11:51:04.390884 │
   └────────────────────────────┘

pg_clickhouse's binary engine's conversion loses precision, returning 2025-12-05 11:51:04.390883.

It would be better to handle the precision calculation for all of these data types losslessly, such that float64 precision limits don't monkey with the values.

Does not affect the http engine because it simply parses a text value. Perhaps ColumnDateTime64 needs a AsString() method like ClickHouse/clickhouse-cpp#451 proposes for ColumnDecimal.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdata typesImprove data type supportenginesImprove binary and/or http engine support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions