Skip to content

Commit

Permalink
[Hotfix][Jdbc] Fix oracle savemode create table (#6651)
Browse files Browse the repository at this point in the history
  • Loading branch information
hailin0 committed May 14, 2024
1 parent ee3b7c3 commit 4b6c13e
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,21 @@ protected String getCreateTableSql(TablePath tablePath, CatalogTable table) {
return new OracleCreateTableSqlBuilder(table).build(tablePath);
}

@Override
protected void createTableInternal(TablePath tablePath, CatalogTable table)
throws CatalogException {
String dbUrl = getUrlFromDatabaseName(tablePath.getDatabaseName());
try {
String createTableSQL = getCreateTableSql(tablePath, table);
for (String sql : createTableSQL.split(";")) {
executeInternal(dbUrl, sql);
}
} catch (Exception e) {
// fallback to super
super.createTableInternal(tablePath, table);
}
}

@Override
protected String getDropTableSql(TablePath tablePath) {
return String.format("DROP TABLE %s", tablePath.getSchemaAndTableName("\""));
Expand Down

0 comments on commit 4b6c13e

Please sign in to comment.