Skip to content

Query settings session_timezone not being applied #1464

Closed
ClickHouse/ClickHouse
#63377
@tecpcarrier

Description

@tecpcarrier

Describe the bug

Clickhouse allows user to set query to multiple level including at the query level. When the setting session_timezone is set in dbeaver , the setting is not being picked up. I have looked at this issue #604 where the timezone is set correctly for toDateTime but it does not seem to be the case when using this setting. Whenever I use session_timezone, the datetime uses the wrong timezone.

image

In this query, the date should be identical to the second column not the third. Running it directly using clickhouse-client, the result of this query should be the following:

image

By changing the session_timezone, the value in the first column should change to adapt to the new timezone.

Configuration

ClickHouse server

  • ClickHouse Server version: 23.8.2.7
  • Statement:
WITH temp AS
    (
        SELECT 1696431276 AS date
    )
SELECT
    toDateTime(date),
    toDateTime(date, 'America/New_York'),
    toDateTime(date, 'UTC')
FROM temp
SETTINGS session_timezone = 'America/Vancouver'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions