Repository navigation
Conversation
…properties is enabled
JingsongLi
left a comment
There was a problem hiding this comment.
I ran all 86 JdbcCatalogTest cases on JDK 8 and exercised the public catalog factory against MySQL 8.0.43 with utf8mb4. With sync disabled, catalog creation, table creation and ALTER, and a committed write/read round trip succeed without paimon_table_properties. Precreating the table with shorter key columns also lets the same catalog reopen with sync enabled and persist an altered option.
| } | ||
| }); | ||
| // Check and create table properties table. It is only used to sync table properties. | ||
| if (syncTableProperties()) { |
There was a problem hiding this comment.
[P2] Document the MySQL setup requirement in the JDBC catalog guide. On a fresh MySQL 8.0.43 database using utf8mb4, the CREATE CATALOG example in the JDBC catalog guide still stops at InnoDB error 1071 with the default options. The working configuration introduced here is currently discoverable only after inspecting the nested exception. Please document when to set sync-all-properties=false, what that means for syncing table properties, and how users who need sync can precreate a compatible table.
There was a problem hiding this comment.
Thanks for testing it on MySQL. I added a "MySQL with utf8mb4" section to the JDBC catalog guide. It explains why the catalog fails with the default options, when to set sync-all-properties to false and what that changes (the table is neither created nor written; table options stay in the schema files), and gives a CREATE TABLE with shorter catalog_key and property_key columns for users who need the sync, with the resulting length limits. I checked both setups on MySQL 8.0.46 with utf8mb4.
Purpose
Linked issue: close #11096
Since 1.4.0 (#7423), the JDBC catalog creates
paimon_table_propertiesat startup. Its primary key has fourVARCHAR(255)columns, which take 4080 bytes on MySQL withutf8mb4, above InnoDB's 3072-byte limit, so the catalog fails to start withSpecified key was too long.The table is only used to sync table properties: every read and write of it is already behind
sync-all-properties, and the catalog reads table options from the schema files, not from this table. This PR:sync-all-propertiesis true, so a catalog with the sync disabled starts on MySQLutf8mb4;sync-all-propertiesto false, or create the table before the catalog starts (for example with shorter key columns). The default staystrue, so the default setup on MySQLutf8mb4still needs one of them.As discussed in the issue, a length option like
lock-key-max-lengthis left out: it would have to shorten all four key columns, including the database and table names thatpaimon_tableskeeps at 255. Happy to change the approach if you prefer something else.Tests
JdbcCatalogTest:testTablePropertiesTableCreatedOnlyWhenSyncEnabled: with the sync disabled the table is not created; enabling it later on the same database creates it.testTablePropertiesTableCreationFailure: when creating the table fails, the error names the table andsync-all-properties, and the catalog still starts with the sync disabled.testTablePropertiesSyncDisablednow checks that the table does not exist, instead of reading it.All 86 tests in
JdbcCatalogTestpass. I also ran the catalog against MySQL 8.0.46 with autf8mb4database:sync-all-properties= true)Specified key was too longsync-all-properties= falsepaimon_table_propertiesis not createdcatalog_keyandproperty_keyAPI and Format
No API or storage format change. With
sync-all-properties= false, the JDBC catalog no longer createspaimon_table_properties.Documentation
No.