Skip to content

Commit

Permalink
remove change in AbstractCatalog
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry-024 committed Dec 18, 2024
1 parent fdf29b0 commit 064f7a6
Showing 1 changed file with 13 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,29 +300,21 @@ public void createTable(Identifier identifier, Schema schema, boolean ignoreIfEx
}

copyTableDefaultOptions(schema.options());
try {
switch (Options.fromMap(schema.options()).get(TYPE)) {
case TABLE:
case MATERIALIZED_TABLE:
createTableImpl(identifier, schema);
break;
case OBJECT_TABLE:
createObjectTable(identifier, schema);
break;
case FORMAT_TABLE:
createFormatTable(identifier, schema);
break;
}
} catch (TableAlreadyExistException e) {
if (ignoreIfExists) {
return;
}
throw e;
switch (Options.fromMap(schema.options()).get(TYPE)) {
case TABLE:
case MATERIALIZED_TABLE:
createTableImpl(identifier, schema);
break;
case OBJECT_TABLE:
createObjectTable(identifier, schema);
break;
case FORMAT_TABLE:
createFormatTable(identifier, schema);
break;
}
}

private void createObjectTable(Identifier identifier, Schema schema)
throws TableAlreadyExistException {
private void createObjectTable(Identifier identifier, Schema schema) {
RowType rowType = schema.rowType();
checkArgument(
rowType.getFields().isEmpty()
Expand All @@ -337,8 +329,7 @@ private void createObjectTable(Identifier identifier, Schema schema)
createTableImpl(identifier, schema.copy(ObjectTable.SCHEMA));
}

protected abstract void createTableImpl(Identifier identifier, Schema schema)
throws TableAlreadyExistException;
protected abstract void createTableImpl(Identifier identifier, Schema schema);

@Override
public void renameTable(Identifier fromTable, Identifier toTable, boolean ignoreIfNotExists)
Expand Down

0 comments on commit 064f7a6

Please sign in to comment.