[FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type#4295
[FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type#4295zml1206 wants to merge 4 commits intoapache:masterfrom
Conversation
…ble without data type [FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type
|
@lvyanquan Can you help take a look? I'm not sure if getting a table column dataType from historyRecord is reliable. |
There was a problem hiding this comment.
Pull request overview
This PR adds Oracle support for ALTER TABLE ... MODIFY <col> NULL/NOT NULL statements that omit the column data type (e.g., ALTER TABLE t MODIFY a NULL) by ensuring the parser can reuse the existing column schema.
Changes:
- Extend Oracle connector IT coverage to include changing a column from
NOT NULLtoNULLwithout specifying a data type. - Update the Oracle ALTER TABLE parser to look up the existing column definition and only require a datatype when the column schema is missing.
- Hydrate/refresh the in-memory
Tablescache in the Oracle event deserializer using DebeziumHistoryRecordTABLE_CHANGES, enabling parsing of datatype-omitted ALTERs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.../OraclePipelineITCase.java |
Adds an integration test sequence that exercises MODIFY <col> NULL without datatype and updates expected schema-change events accordingly. |
.../OracleAlterTableParserListener.java |
Switches to editing/creating tables from Debezium’s databaseTables() and enables MODIFY ... NULL parsing by editing existing column schema when available. |
.../OracleEventDeserializer.java |
Preloads Tables state from HistoryRecord.Fields.TABLE_CHANGES so the parser has column schemas available during ALTER parsing. |
Comments suppressed due to low confidence (1)
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-oracle/src/test/java/org/apache/flink/cdc/connectors/oracle/source/OraclePipelineITCase.java:1740
- The schema name argument is inconsistent here ("DEBEZIUM" vs "debezium" used throughout the rest of this test). Even though Oracle treats unquoted identifiers case-insensitively, keeping the casing consistent avoids confusion and makes the intent clearer.
statement.execute(String.format("ALTER TABLE %s.products MODIFY DESC1 NULL", "DEBEZIUM"));
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
CC @linjianchang as you may be interested in this. |
Oracle support change column nullable without data type, for example