Fixed logic of before/after struct. Added view as a separate table to avoid stack size exception(TOO_MUCH_RECURSION) in ClickHouse.

This commit is contained in:
Kanthi Subramanian 2022-06-14 12:55:39 -04:00
parent de7f50e14f
commit 879d998517
2 changed files with 13 additions and 3 deletions

View File

@ -102,5 +102,14 @@ CREATE TABLE topic_offset_metadata(
ENGINE = MergeTree
PRIMARY KEY _topic;
CREATE MATERIALIZED VIEW mv_topic_offset_metadata_view to topic_offset_metadata
CREATE TABLE topic_offset_metadata_view
(
`_topic` String,
`_partition` UInt64,
`_offset` UInt64
) Engine=MergeTree
PRIMARY KEY _topic;
CREATE MATERIALIZED VIEW mv_topic_offset_metadata_view to topic_offset_metadata_view
AS select _topic, _partition, MAX(_offset) as _offset from topic_offset_metadata tom group by _topic, _partition;

View File

@ -105,8 +105,9 @@ public class ClickHouseStruct {
if(key != null) {
this.key = key.toString();
}
this.beforeStruct = beforeStruct;
this.afterStruct = afterStruct;
setBeforeStruct(beforeStruct);
setAfterStruct(afterStruct);
this.setAdditionalMetaData(metadata);
this.cdcOperation = operation;
}