itinycheng / flink-connector-clickhouse

Flink SQL connector for ClickHouse. Support ClickHouseCatalog and read/write primary data, maps, arrays to clickhouse.
Apache License 2.0
374 stars 156 forks source link

Tables in ClickhouseCatalog have no primary key #64

Closed zidane-wcp closed 1 year ago

zidane-wcp commented 1 year ago

I found that the table in ClickhouseCatalog has no primary key, so I can't use ClickhouseCatalog in upsert mode. Could you please add the primary key of the table in ClickhouseCatalog?

itinycheng commented 1 year ago

Use option catalog.ignore-primary-key=false

zidane-wcp commented 1 year ago

Thank you. I just found this option.

zidane-wcp commented 1 year ago

Use option catalog.ignore-primary-key=false

The order of the primary key columns in ClickhouseCatalog is not the same as in the table definition.

itinycheng commented 1 year ago

Use option catalog.ignore-primary-key=false

The order of the primary key columns in ClickhouseCatalog is not the same as in the table definition.

@zidane-wcp Yes, seems to follow the column definition order, refer to: ClickHouseCatalog.getPartitionKeys. Are there any scenarios where the primary keys need to keep the order in which they are defined?