-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from Altinity/fix_datetime_limits
Fix datetime limits
- Loading branch information
Showing
60 changed files
with
3,534 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM openjdk:11 | ||
FROM openjdk:17 | ||
COPY sink-connector-client/sink-connector-client /sink-connector-client | ||
COPY sink-connector-lightweight/target/clickhouse-debezium-embedded-1.0-SNAPSHOT.jar /app.jar | ||
COPY sink-connector-lightweight/target/clickhouse-debezium-embedded*.jar /app.jar | ||
ENV JAVA_OPTS="-Dlog4jDebug=true" | ||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/app.jar", "/config.yml", "com.altinity.clickhouse.debezium.embedded.ClickHouseDebeziumEmbeddedApplication"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
## Time Zone | ||
|
||
### MySQL | ||
1. The environment variable `TZ=US/Central` in docker-compose under mysql can be used to set the timezone for MySQL. | ||
|
||
2. To make sure the timezone is properly set in MySQL, run the following SQL on MySQL Server. | ||
|
||
`select @@system_time_zone` | ||
|
||
3. Set the `database.connectionTimezone: 'US/Central'` in config.yml to make sure the sink connector performs the datetime/timestamp conversions using the same timezone. | ||
|
||
Note: With the new version of Debezium there are no errors if the `database.connectionTimeZone` is not set and if the MySQL server is set to a different timezone | ||
`TZ=US/Central` | ||
|
||
### ClickHouse | ||
|
||
To check the ClickHouse server timezone. | ||
``` | ||
SELECT timezone() | ||
Query id: f7b665b5-639f-4e1c-b494-256744c4310f | ||
┌─timezone()──────┐ | ||
│ America/Chicago │ | ||
└─────────────────┘ | ||
``` | ||
The configuration variable `clickhouse.datetime.timezone: "UTC"` is to used to force the timezone for `DateTime/DateTime64` fields | ||
when its persisted to ClickHouse. By Default the server timezone will be used. | ||
``` | ||
SELECT toDateTime(Mid_Value, 'UTC') AS utc_time | ||
FROM temporal_types_DATETIME5 | ||
Query id: f6c735bc-cdb3-4df6-995d-00dfe2d13ae8 | ||
┌────────────utc_time─┐ | ||
│ 2022-09-29 06:50:28 │ | ||
└─────────────────────┘ | ||
d1c194dbabc3 :) select toDateTime(Mid_Value, 'America/Chicago') as chicago_time from temporal_types_DATETIME5; | ||
SELECT toDateTime(Mid_Value, 'America/Chicago') AS chicago_time | ||
FROM temporal_types_DATETIME5 | ||
Query id: 77602998-f7f8-4bfb-b7a4-2a2034541c62 | ||
┌────────chicago_time─┐ | ||
│ 2022-09-29 01:50:28 │ | ||
SELECT * | ||
FROM temporal_types_DATETIME5 | ||
Query id: c2f743df-f64e-4037-ad85-6363f9d7f11c | ||
┌─Type────────┬─────────────Minimum_Value─┬─────────────────Mid_Value─┬─────────────Maximum_Value─┬─Null_Value─┬────────────_version─┬─is_deleted─┐ | ||
│ DATETIME(5) │ 1900-01-01 00:00:00.00000 │ 2022-09-29 01:50:28.12345 │ 2299-12-31 23:59:59.99999 │ ᴺᵁᴸᴸ │ 1730606158705590330 │ 0 │ | ||
└─────────────┴───────────────────────────┴───────────────────────────┴───────────────────────────┴────────────┴─────────────────────┴────────────┘ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<clickhouse replace="true"> | ||
<user_directories> | ||
<users_xml> | ||
<path>users.xml</path> | ||
</users_xml> | ||
<local_directory> | ||
<path>/var/lib/clickhouse/access/</path> | ||
</local_directory> | ||
</user_directories> | ||
<timezone>America/Chicago</timezone> | ||
</clickhouse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.