-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logic to override DateTime/DateTime64 insert syntax to String
- Loading branch information
Showing
4 changed files
with
238 additions
and
2 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
102 changes: 102 additions & 0 deletions
102
sink-connector-lightweight/src/test/resources/init_clickhouse_schema_only.sql
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,102 @@ | ||
--CREATE USER 'ch_user' IDENTIFIED WITH plaintext_password BY 'root'; | ||
--SET allow_introspection_functions=1; | ||
--GRANT ALL ON . TO 'ch_user' WITH GRANT OPTION | ||
-- | ||
-- | ||
-- CREATE USER ch_user IDENTIFIED WITH plaintext_password BY 'password'; | ||
CREATE database datatypes; | ||
CREATE database employees; | ||
CREATE database public; | ||
CREATE database project; | ||
|
||
CREATE TABLE project.items | ||
( | ||
`price` Int64, | ||
`name` String, | ||
`_id` String, | ||
`uuid` String, | ||
`_sign` Int8, | ||
`_version` UInt64 | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY _id; | ||
|
||
|
||
CREATE TABLE public.protocol_test | ||
( | ||
`id` Int64, | ||
`consultation_id` Int64, | ||
`recomendation` Nullable(String), | ||
`create_date` DateTime64(6), | ||
`_sign` Int8, | ||
`_version` UInt64 | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY id; | ||
|
||
CREATE DATABASE altinity_sink_connector; | ||
|
||
CREATE TABLE altinity_sink_connector.replica_source_info | ||
( | ||
`id` String, | ||
`offset_key` String, | ||
`offset_val` String, | ||
`record_insert_ts` DateTime, | ||
`record_insert_seq` UInt64, | ||
`_version` UInt64 MATERIALIZED toUnixTimestamp64Nano(now64(9)) | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY id | ||
SETTINGS index_granularity = 8198; | ||
|
||
USE employees; | ||
CREATE TABLE employees.dt | ||
( | ||
`timestamp` DateTime('Asia/Istanbul'), | ||
`json` String, | ||
`event_id` UInt8, | ||
`sign` Int8, | ||
`_version` UInt64 MATERIALIZED toUnixTimestamp64Nano(now64(9)), | ||
`_updated` DateTime MATERIALIZED now() | ||
) | ||
ENGINE = ReplacingMergeTree(_version) ORDER by event_id; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime, | ||
`Mid_Value` DateTime64, | ||
`Maximum_Value` DateTime, | ||
`Null_Value` Nullable(DateTime), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME1 | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime, | ||
`Mid_Value` DateTime, | ||
`Maximum_Value` DateTime, | ||
`Null_Value` Nullable(DateTime), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME2 | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime, | ||
`Mid_Value` DateTime, | ||
`Maximum_Value` DateTime, | ||
`Null_Value` Nullable(DateTime), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) | ||
ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; |
102 changes: 102 additions & 0 deletions
102
...-connector-lightweight/src/test/resources/init_clickhouse_schema_only_column_timezone.sql
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,102 @@ | ||
--CREATE USER 'ch_user' IDENTIFIED WITH plaintext_password BY 'root'; | ||
--SET allow_introspection_functions=1; | ||
--GRANT ALL ON . TO 'ch_user' WITH GRANT OPTION | ||
-- | ||
-- | ||
-- CREATE USER ch_user IDENTIFIED WITH plaintext_password BY 'password'; | ||
CREATE database datatypes; | ||
CREATE database employees; | ||
CREATE database public; | ||
CREATE database project; | ||
|
||
CREATE TABLE project.items | ||
( | ||
`price` Int64, | ||
`name` String, | ||
`_id` String, | ||
`uuid` String, | ||
`_sign` Int8, | ||
`_version` UInt64 | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY _id; | ||
|
||
|
||
CREATE TABLE public.protocol_test | ||
( | ||
`id` Int64, | ||
`consultation_id` Int64, | ||
`recomendation` Nullable(String), | ||
`create_date` DateTime64(6), | ||
`_sign` Int8, | ||
`_version` UInt64 | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY id; | ||
|
||
CREATE DATABASE altinity_sink_connector; | ||
|
||
CREATE TABLE altinity_sink_connector.replica_source_info | ||
( | ||
`id` String, | ||
`offset_key` String, | ||
`offset_val` String, | ||
`record_insert_ts` DateTime, | ||
`record_insert_seq` UInt64, | ||
`_version` UInt64 MATERIALIZED toUnixTimestamp64Nano(now64(9)) | ||
) | ||
ENGINE = ReplacingMergeTree(_version) | ||
ORDER BY id | ||
SETTINGS index_granularity = 8198; | ||
|
||
USE employees; | ||
CREATE TABLE employees.dt | ||
( | ||
`timestamp` DateTime('Asia/Istanbul'), | ||
`json` String, | ||
`event_id` UInt8, | ||
`sign` Int8, | ||
`_version` UInt64 MATERIALIZED toUnixTimestamp64Nano(now64(9)), | ||
`_updated` DateTime MATERIALIZED now() | ||
) | ||
ENGINE = ReplacingMergeTree(_version) ORDER by event_id; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime64('Asia/Istanbul'), | ||
`Mid_Value` DateTime64('Asia/Istanbul'), | ||
`Maximum_Value` DateTime64('Asia/Istanbul'), | ||
`Null_Value` Nullable(DateTime64('Asia/Istanbul')), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME1 | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime64('Asia/Istanbul'), | ||
`Mid_Value` DateTime64('Asia/Istanbul'), | ||
`Maximum_Value` DateTime64('Asia/Istanbul'), | ||
`Null_Value` Nullable(DateTime64('Asia/Istanbul')), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; | ||
|
||
CREATE TABLE employees.temporal_types_DATETIME2 | ||
( | ||
`Type` String, | ||
`Minimum_Value` DateTime64('Asia/Istanbul'), | ||
`Mid_Value` DateTime64('Asia/Istanbul'), | ||
`Maximum_Value` DateTime64('Asia/Istanbul'), | ||
`Null_Value` Nullable(DateTime64('Asia/Istanbul')), | ||
`_version` UInt64, | ||
`is_deleted` UInt8 | ||
) | ||
ENGINE = ReplacingMergeTree(_version, is_deleted) | ||
ORDER BY Type | ||
SETTINGS index_granularity = 8192; |
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