[Fix][Connector-V2] Fix OceanBase Oracle create unsupported data type#9383
Merged
Conversation
Hisoka-X
commented
May 29, 2025
| createTableSql.append(String.join(",\n", columnSqls)); | ||
| createTableSql.append("\n)"); | ||
| sqls.add(createTableSql.toString()); | ||
| if (comment != null) { |
Member
Author
There was a problem hiding this comment.
also fix oracle create table without table comment problem
Contributor
There was a problem hiding this comment.
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 =
| createTableSql.append(String.join(",\n", columnSqls)); | ||
| createTableSql.append("\n)"); | ||
| sqls.add(createTableSql.toString()); | ||
| if (comment != null) { |
There was a problem hiding this comment.
[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)) { |
hailin0
approved these changes
Jun 10, 2025
corgy-w
approved these changes
Jun 11, 2025
chncaesar
pushed a commit
to chncaesar/seatunnel
that referenced
this pull request
Jun 30, 2025
dybyte
pushed a commit
to dybyte/seatunnel
that referenced
this pull request
Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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