Open echang0929 opened 3 years ago
Same here. Using JdbcSinkConnector, Type: sink, Version: 10.2.0.
Starting from a connector working like a charm, adding PARTITION BY RANGE()
to the table definition (and creating some partitions) makes it fail:
Checking PostgreSql dialect for existence of TABLE "hourly_measures"", "context":"[hourly_measures_aggregatesdb_sink|task-0]
Using PostgreSql dialect TABLE "hourly_measures" absent", "context":"[hourly_measures_aggregatesdb_sink|task-0]
io.confluent.connect.jdbc.sink.TableAlterOrCreateException: Table "hourly_measures" is missing and auto-creation is disabled
Although:
select * from information_schema.tables where table_name like 'hourly%';
table_catalog | table_schema | table_name | table_type | self_referencing_column_name | reference_generation | user_defined_type_catalog | user_defined_type_schema | user_defined_type_name | is_insertable_into | is_typed | commit_action |
---|---|---|---|---|---|---|---|---|---|---|---|
aggregates | public | hourly_measures | BASE TABLE | YES | NO | ||||||
aggregates | public | hourly_measures_202107 | BASE TABLE | YES | NO |
The problem is this change in the underlying pgjdbc implem: https://github.com/pgjdbc/pgjdbc/commit/25eb32c8681eaa4aaac801808b6028e9f5dfbea8#diff-0571f8ac3385a7f7bb34e5c77f8afd24810311506989379c2e85c6c16eea6ce4L1287
But this does not map nicely to this enum https://github.com/confluentinc/kafka-connect-jdbc/blob/60df0624278a0ee162d7774332fadf03992ea147/src/main/java/io/confluent/connect/jdbc/util/TableType.java#L24.
Thanks for the details @mdespriee ; I've added https://github.com/confluentinc/kafka-connect-jdbc/pull/1156 to hopefully resolve this going forward.
As of 10.6.0 there's now support for partitioned tables again.
Update the plugin and in your connectors pass:
"table.types": "PARTITIONED TABLE,TABLE"
@echang0929 can you confirm & close this issue?
For what it's worth, I'm running version 10.7.4 of this connector and specifying those table type values worked for me against a partitioned table in PostgreSQL.
I upgraded our Confluent Community Package helm cluster from 5.4.1 to 6.0.1, and installed jdbc plugin:
However, the new cluster can not support partitioned tables:
So, I replaced the new version of Postgresql driver with the old one on CCP 5.4.1:
Then, it is working now.