Skip to content

Conversation

@Hisoka-X
Copy link
Member

Purpose of this pull request

Fix OceanBase Oracle create unsupported data type when source is oracle, for example LONG, LONG RAW etc.

Does this PR introduce any user-facing change?

no

How was this patch tested?

add new test.

Check list

createTableSql.append(String.join(",\n", columnSqls));
createTableSql.append("\n)");
sqls.add(createTableSql.toString());
if (comment != null) {
Copy link
Member Author

Choose a reason for hiding this comment

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

also fix oracle create table without table comment problem

@nielifeng nielifeng requested a review from Copilot May 30, 2025 05:24
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

Fix handling of Oracle data types unsupported by OceanBase and enhance table/comment SQL generation.

  • Extend OracleCreateTableSqlBuilder to include table comments and expose buildColumnSql for subclassing.
  • Introduce OceanBaseOracleCreateTableSqlBuilder to remap unsupported Oracle types (LONG, LONG RAW, BFILE, NCLOB, REAL) when targeting OceanBase.
  • Add new unit tests and update OracleTypeConverter to recognize BFILE.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
connector-jdbc/.../OracleCreateTableSqlBuilderTest.java Updated test to capture table comment in returned SQL list.
connector-jdbc/.../OceanBaseOracleCreateTableSqlBuilderTest.java New tests for remapping unsupported Oracle types in OceanBase mode.
connector-jdbc/.../OracleTypeConverter.java Added ORACLE_BFILE constant and converter case for BFILE.
connector-jdbc/.../OracleCreateTableSqlBuilder.java Added table-comment SQL, changed buildColumnSql visibility, introduced column-comments list (not yet applied).
connector-jdbc/.../OracleCatalog.java Redirected getCreateTableSql to use new list-based API.
connector-jdbc/.../OceanBaseOracleCreateTableSqlBuilder.java Subclassed Oracle builder to apply type remapping in compatibility mode.
connector-jdbc/.../OceanBaseOracleCatalog.java Overrode to use OceanBase-specific builder.
Comments suppressed due to low confidence (1)

seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oracle/OracleCreateTableSqlBuilder.java:84

  • The commentSqls list is constructed but never added to the sqls list. Consider calling sqls.addAll(commentSqls) before returning to include column-level COMMENT statements.
List<String> commentSqls =

createTableSql.append(String.join(",\n", columnSqls));
createTableSql.append("\n)");
sqls.add(createTableSql.toString());
if (comment != null) {
Copy link

Copilot AI May 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Use StringUtils.isNotBlank(comment) instead of comment != null to avoid emitting an empty COMMENT ON TABLE statement when the comment is an empty string.

Suggested change
if (comment != null) {
if (StringUtils.isNotBlank(comment)) {

Copilot uses AI. Check for mistakes.
@corgy-w corgy-w merged commit f4178c7 into apache:dev Jun 11, 2025
5 checks passed
chncaesar pushed a commit to chncaesar/seatunnel that referenced this pull request Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants