Skip to content

Partition min/max incorrectly calculated for timestamp (millis) #85

@subkanthi

Description

@subkanthi

ICE

clickhouse local --query "select toDateTime(toDate(now()) + interval number second) as _time, 1 as value from numbers(86400) format Parquet" > test.parquet
./ice insert test.test4 -p test.parquet --partition='[{"column":"_time", "transform": "day"}]'
./ice insert test.test5 -p test.parquet
 :) set iceberg_timezone_for_timestamptz ='America/Chicago';

SET iceberg_timezone_for_timestamptz = 'America/Chicago'

Query id: 27156193-fa6b-4dd0-b9e7-7c90d49e085b

Ok.

0 rows in set. Elapsed: 0.002 sec.

 :) select count(*), min(_time), max(_time) from `test.test4`;

SELECT
    count(*),
    min(_time),
    max(_time)
FROM `test.test4`

Query id: 5f2bd8c8-01ca-4323-8fd8-97641dd32afe

   ┌─count()─┬─────────────────min(_time)─┬─────────────────max(_time)─┐
1. │   86400 │ 2025-12-16 00:00:00.000000 │ 2025-12-16 23:59:59.000000 │
   └─────────┴────────────────────────────┴────────────────────────────┘

1 row in set. Elapsed: 0.010 sec. Processed 86.40 thousand rows, 273.82 KB (8.96 million rows/s., 28.39 MB/s.)
Peak memory usage: 822.20 KiB.

:) select count(*), min(_time), max(_time) from `test.test4` where _time >= '2025-12-16 18:05:00' and _time < '2025-12-16 18:10:00' settings use_iceberg_partition_pruning = 1;

SELECT
    count(*),
    min(_time),
    max(_time)
FROM `test.test4`
WHERE (_time >= '2025-12-16 18:05:00') AND (_time < '2025-12-16 18:10:00')
SETTINGS use_iceberg_partition_pruning = 1

Query id: 7296a2d9-e56f-400c-afa0-8ce597e07039

   ┌─count()─┬─────────────────min(_time)─┬─────────────────max(_time)─┐
1. │       0 │ 1969-12-31 18:00:00.000000 │ 1969-12-31 18:00:00.000000 │
   └─────────┴────────────────────────────┴────────────────────────────┘

1 row in set. Elapsed: 0.009 sec.

^^^^ BUG expected 300 got 0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions