Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use datetime in bulk load under dotnet 6.0 #44

Open
UncleJosef opened this issue Jan 24, 2022 · 2 comments
Open

use datetime in bulk load under dotnet 6.0 #44

UncleJosef opened this issue Jan 24, 2022 · 2 comments
Assignees

Comments

@UncleJosef
Copy link

When working under dotnet 6.0 with date fields, a timezone error appears. When the same code is running under dotnet 5.0, such an error does not occur.

@funcmike
Copy link

funcmike commented Feb 8, 2022

I'm using bulk loader under dotnet 6.0 it works ok with
DateTime[] startAt = new DateTime [batchSize]; // Clickhouse schema DateTime('UTC')

@victor-sushko
Copy link
Contributor

Versions of ClickHouseClient for .Net 6 and .Net 5 have different approaches for handling time zones. The version for .Net 6 uses new time zone conversion API. The version for .Net 5 relies on TimeZoneConverter.

There may be two possible reasons for a time zone error in the .Net 6 version of ClickHouseClient.

  1. An application is running in the invariant globalization mode. In this case very limited set of time zones is supported by the runtime both on Windows and on Linux.
  2. An application is running on Windows and is not in the invariant globalization mode. In this case there are several time zones which are supported by ClickHouse but are unknown to the runtime.

Here is the query for a list of time zones supported by ClickHouse:

SELECT * FROM system.time_zones

I checked time zones from this list on different version of ClickHouseClient running on Windows.

Here are time zones which are not supported in the ClickHouseClient version for .Net 5 (Windows):

America/Fort_Wayne
Antarctica/Troll
Factory
Pacific/Kanton

And here are time zones which are not supported in the ClickHouseClient version for .Net 6 (Windows):

Antarctica/Troll
Asia/Kashgar
Asia/Urumqi
CET
EET
Factory
MET
Pacific/Kanton
WET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants