Skip to content

[FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type#4295

Open
zml1206 wants to merge 4 commits intoapache:masterfrom
zml1206:FLINK-39196
Open

[FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type#4295
zml1206 wants to merge 4 commits intoapache:masterfrom
zml1206:FLINK-39196

Conversation

@zml1206
Copy link
Contributor

@zml1206 zml1206 commented Mar 3, 2026

Oracle support change column nullable without data type, for example

ALTER TABLE t MODIFY a NULL

zml1206 added 2 commits March 3, 2026 17:07
…ble without data type

[FLINK-39196][pipeline-connector][oracle] Support change column nullable without data type
@zml1206 zml1206 marked this pull request as draft March 3, 2026 10:26
@zml1206 zml1206 marked this pull request as ready for review March 4, 2026 02:42
@zml1206
Copy link
Contributor Author

zml1206 commented Mar 4, 2026

@lvyanquan Can you help take a look? I'm not sure if getting a table column dataType from historyRecord is reliable.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 NULL to NULL without 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 Tables cache in the Oracle event deserializer using Debezium HistoryRecord TABLE_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.

@lvyanquan
Copy link
Contributor

CC @linjianchang as you may be interested in this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants