Skip to content

Iceberg database table timestampz columns appears as UTC on existing Iceberg tables #86641

@aadant

Description

@aadant

Company or project name

No response

Describe the unexpected behaviour

UTC is a good default but what about the database timezone or a way to override the timezone.

Suppose you have an existing Iceberg table and you want to query it from ClickHouse.

CREATE DATABASE test
ENGINE = Iceberg('http://fpif1-dbal2:5000/v1', 'minio', 'minio123')
SETTINGS catalog_type = 'rest', storage_endpoint = 'http://fpif1-dbal2:9002/warehouse', warehouse = 'iceberg';

or

CREATE DATABASE test
ENGINE = DataLakeCatalog('http://fpif1-dbal2:5000/v1', 'minio', '[HIDDEN]')
SETTINGS catalog_type = 'rest', storage_endpoint = 'http://fpif1-dbal2:9002/warehouse', warehouse = 'iceberg'

then query a table that has a timestampz, it will appear as DateTime64(6,'UTC)

:) select timezone();

SELECT timezone()

Query id: 1f746966-b1ca-4b7f-bb9f-66bea48e6ed1

   ┌─timezone()──────┐
1. │ America/Chicago │
   └─────────────────┘

1 row in set. Elapsed: 0.001 sec.

:) show create table test.test\G

SHOW CREATE TABLE test.test

Query id: a4fd8a64-d3bf-468e-8365-347030487314

Row 1:
──────
statement: CREATE TABLE test.test
(
    `current_time` DateTime64(6, 'UTC')
)
ENGINE = IcebergS3('http://fpif1-dbal2:9002/warehouse/test/test', 'minio', '[HIDDEN]', 'Parquet')

1 row in set. Elapsed: 0.001 sec.

How to reproduce

reproduces in 25.8
see description.

Expected behavior

  • the timezone should be the same as the server timezone, I think it is sensible default.
  • or there should be a way to specify the timezone on the create database statement.

Please note that if you manually attach the table using create table, it works as expected.

CREATE TABLE test2
(
    `current_time` DateTime64(6, 'America/Chicago')
)
ENGINE = IcebergS3('http://fpif1-dbal2:9002/warehouse/test/test', 'minio', 'minio123')

Error message and/or stacktrace

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp-datalakeData lake table formats (Iceberg/Delta/Hudi) integration.unfinished code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions