-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Fix][Connector-V2] Fix OceanBase Oracle create unsupported data type #9383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| createTableSql.append(String.join(",\n", columnSqls)); | ||
| createTableSql.append("\n)"); | ||
| sqls.add(createTableSql.toString()); | ||
| if (comment != null) { |
There was a problem hiding this comment.
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
There was a problem hiding this 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
OracleCreateTableSqlBuilderto include table comments and exposebuildColumnSqlfor subclassing. - Introduce
OceanBaseOracleCreateTableSqlBuilderto remap unsupported Oracle types (LONG, LONG RAW, BFILE, NCLOB, REAL) when targeting OceanBase. - Add new unit tests and update
OracleTypeConverterto 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
commentSqlslist is constructed but never added to thesqlslist. Consider callingsqls.addAll(commentSqls)before returning to include column-level COMMENT statements.
List<String> commentSqls =
...tunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCreateTableSqlBuilder.java
Outdated
Show resolved
Hide resolved
| createTableSql.append(String.join(",\n", columnSqls)); | ||
| createTableSql.append("\n)"); | ||
| sqls.add(createTableSql.toString()); | ||
| if (comment != null) { |
Copilot
AI
May 30, 2025
There was a problem hiding this comment.
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.
| if (comment != null) { | |
| if (StringUtils.isNotBlank(comment)) { |
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
New License Guide