Creating a Table With PRIMARY KEY in MySQL With DATETIME Column Results in a Wrong Precision Value in ClickHouse #462
Labels
bug
Something isn't working
GA-1
All the issues that are issues in release(Scheduled Dec 2023)
qa-verified
label to mark issues that were verified by QA
When creating a table in MySQL with
DATETIME
columns and specifying precision, the table is replicated to ClickHouse with DateTime64 but with the wrong precision value. This seems to happen only when we specifyPRIMARY KEY
in MySQL table.For example,
In MySQL
In ClickHouse
Auto create, creates a table with
DateTime64(0)
instead ofDateTime64(3)
. This happens for all precision values1-6
.One thing to note here is that the ClickHouse DateTime64 is created with precision 0 when we specify timezone configurations for sink-connector:
If we remove these configurations, the issue persists but the ClickHouse
DateTime64
precision values always sets to 3 now.┌─name───────┬─type───────────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐ │ id │ Int32 │ │ │ │ │ │ │ data │ Nullable(DateTime64(3)) │ │ │ │ │ │ │ _version │ UInt64 │ │ │ │ │ │ │ is_deleted │ UInt8 │ │ │ │ │ │ └────────────┴────────────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
The issue is gone if we do not specify
PRIMARY KEY
for the MySQL table.The text was updated successfully, but these errors were encountered: