添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
侠义非凡的硬盘  ·  PHP ...·  1 年前    · 
豪气的火车  ·  el-input输入框 ...·  2 年前    · 
害羞的滑板  ·  C# File.Exist ...·  2 年前    · 
耍酷的硬盘  ·  asp.net uploadfile ...·  2 年前    · 

Using UInt64 with partition using toYYYYMMDD produces empty result on queries filtering against negative values #35304

Closed
@fassisrosa

Description

fassisrosa

Describe the issue
A table that includes a field with UInt64 and uses that field to create partition using toYYYYMMDD fails to return values when doing a query for values larger than -1. This used to work in ClickHouse version 20.8.7.15 and it is currently broken in version 22.2.3.1 resulting in broken code.

Which ClickHouse server versions are incompatible
Versions 20.8.7.15 and 22.2.3.1

How to reproduce
Create table and insert data:

CREATE TABLE broken ( time UInt64 ) ENGINE = MergeTree PARTITION BY toYYYYMMDD(toDate(time / 1000)) ORDER BY time;
INSERT INTO broken (time) VALUES (1647353101000), (1647353101001), (1647353101002), (1647353101003);

Run the following queries:

SELECT * FROM broken WHERE time>0;
SELECT * FROM broken WHERE time>-1;

The first query returns all records, the second one returns empty result.