apache / amoro

Apache Amoro (incubating) is a Lakehouse management system built on open data lake formats.
https://amoro.apache.org/
Apache License 2.0
874 stars 290 forks source link

[AMORO-3330] Reducing redundant 'databaseExists' in 'CommonUnifiedCatalog' #3339

Closed zhangwl9 closed 4 hours ago

zhangwl9 commented 1 day ago

Why are the changes needed?

Close #3330

Brief change log

1)the 'databaseExists' call in 'CommonUnifiedCatalog#createDatabase' and 'CommonUnifiedCatalog#dropDatabase' can be suppressed by the subsequent logic, so we delete redundant 'databaseExists' in those functions. 2) the 'databaseExists' in 'CommonUnifiedCatalog#listTables' can not be removed directly, because the 'HudiHadoopCatalog#listTables' and 'MixedCatalog#listTables' methods called in 'FormatCatalog#listTables' do not explicitly throw NoSuchDatabaseException. We add exception handling for NoSuchDatabaseException in these functions to eliminate the redundancy of 'databaseExists' in 'CommonUnifiedCatalog#listTables'.

How was this patch tested?

Documentation