Coder Social home page Coder Social logo

Comments (4)

aadant avatar aadant commented on June 10, 2024

@tellienne which Postgres version is it ?

from clickhouse-sink-connector.

aadant avatar aadant commented on June 10, 2024

See https://groups.google.com/g/debezium/c/NroAVr2saxU

from clickhouse-sink-connector.

tellienne avatar tellienne commented on June 10, 2024

@tellienne which Postgres version is it ?

v.14

from clickhouse-sink-connector.

tellienne avatar tellienne commented on June 10, 2024

See https://groups.google.com/g/debezium/c/NroAVr2saxU

thanks for the link, but it looks like we have a different problem.
In Postgres we create a table using a query

CREATE TABLE public.table_master (
guid varchar(100) NOT NULL,
id uuid NOT NULL,
store_id varchar(100) NOT NULL,
day_updated_at timestamptz NOT NULL,
base_unit varchar(50) NULL,
vat numeric(16, 4) NULL,
price_with(16, 4) NOT NULL,
price_without(16, 4) NOT NULL,
remains numeric(16, 4) NOT NULL,
updated_at timestamptz NOT NULL DEFAULT now(),
CONSTRAINT pk_product_source PRIMARY KEY (guid, id, store_id, day_updated_at)
)
PARTITION BY RANGE (day_updated_at);

After this we have one master table with many table sections that look like
table_2023_03
table_2023_04
table_2023_05
table_2023_06
table_2023_07
table_2023_08 etc

When the connector runs, it treats table sections as separate tables and creates them with a query:

CREATE TABLE db_name.table_2023_03
(

`guid` String,

`id` UUID,

`store_id` String,

`day_updated_at` DateTime64(6),

`base_unit` Nullable(String),

`vat` Nullable(Decimal(16, 4)),

`price_with` Decimal(16, 4),

`price_without` Decimal(16, 4),

`remains` Decimal(16, 4),

`updated_at` DateTime64(6),

`_sign` Int8,

`_version` UInt64

)
ENGINE = ReplacingMergeTree(_version)
PRIMARY KEY (guid,
id,
store_id,
day_updated_at)
ORDER BY (guid,
id,
store_id,
day_updated_at)
SETTINGS index_granularity = 8192;

As a result, in clickhouse, instead of one master table with data, we see many tables, each of which is equal to a partition in Postgres.

from clickhouse-sink-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.