LiebingYu commented on PR #2046:
URL: https://github.com/apache/fluss/pull/2046#issuecomment-3599869641
@nastra Thanks for the PR. LGTM overall, but I think we can also change the
msg in `createTable`.
```java
private void createTable(Identifier tablePath, Schema schema, boolean
isCreatingFlussTable)
throws Catalog.DatabaseNotExistException {
try {
// not ignore if table exists
paimonCatalog.createTable(tablePath, schema, false);
} catch (Catalog.TableAlreadyExistException e) {
try {
Table table = paimonCatalog.getTable(tablePath);
FileStoreTable fileStoreTable = (FileStoreTable) table;
validatePaimonSchemaCompatible(
tablePath, fileStoreTable.schema().toSchema(),
schema);
// if creating a new fluss table, we should ensure the lake
table is empty
if (isCreatingFlussTable) {
checkTableIsEmpty(tablePath, fileStoreTable);
}
} catch (Catalog.TableNotExistException tableNotExistException) {
// shouldn't happen in normal cases
throw new RuntimeException(
String.format(
"Failed to create table %s in Paimon. The
table already existed "
+ "during the initial creation
attempt, but subsequently "
+ "could not be found when trying to
get it. "
+ "Please check whether the Paimon
table was manually deleted, and try again.",
tablePath));
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]