Skip to content

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

Closed
@fassisrosa

Description

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.

Activity

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

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions