Skip to content

Commit 6670b56

Browse files
committed
fix: fix typo in catalog
1 parent 92b61e3 commit 6670b56

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

include/paimon/catalog/catalog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class PAIMON_EXPORT Catalog {
100100
/// @param db_name The name of the database to check for existence.
101101
/// @return A result containing true if the database exists, false otherwise, or an error
102102
/// status.
103-
virtual Result<bool> DataBaseExists(const std::string& db_name) const = 0;
103+
virtual Result<bool> DatabaseExists(const std::string& db_name) const = 0;
104104

105105
/// Checks whether a table with the specified identifier exists in the catalog.
106106
///

src/paimon/core/catalog/file_system_catalog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Status FileSystemCatalog::CreateDatabase(const std::string& db_name,
4949
return Status::Invalid(
5050
fmt::format("Cannot create database for system database {}.", db_name));
5151
}
52-
PAIMON_ASSIGN_OR_RAISE(bool exist, DataBaseExists(db_name));
52+
PAIMON_ASSIGN_OR_RAISE(bool exist, DatabaseExists(db_name));
5353
if (exist) {
5454
if (ignore_if_exists) {
5555
return Status::OK();
@@ -78,10 +78,10 @@ Status FileSystemCatalog::CreateDatabaseImpl(const std::string& db_name,
7878
return Status::OK();
7979
}
8080

81-
Result<bool> FileSystemCatalog::DataBaseExists(const std::string& db_name) const {
81+
Result<bool> FileSystemCatalog::DatabaseExists(const std::string& db_name) const {
8282
if (IsSystemDatabase(db_name)) {
8383
return Status::NotImplemented(
84-
"do not support checking DataBaseExists for system database.");
84+
"do not support checking DatabaseExists for system database.");
8585
}
8686
return fs_->Exists(NewDatabasePath(warehouse_, db_name));
8787
}
@@ -102,7 +102,7 @@ Status FileSystemCatalog::CreateTable(const Identifier& identifier, ArrowSchema*
102102
fmt::format("Cannot create table for system table {}, please use data table.",
103103
identifier.ToString()));
104104
}
105-
PAIMON_ASSIGN_OR_RAISE(bool db_exist, DataBaseExists(identifier.GetDatabaseName()));
105+
PAIMON_ASSIGN_OR_RAISE(bool db_exist, DatabaseExists(identifier.GetDatabaseName()));
106106
if (!db_exist) {
107107
return Status::Invalid(
108108
fmt::format("database {} is not exist", identifier.GetDatabaseName()));

src/paimon/core/catalog/file_system_catalog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class FileSystemCatalog : public Catalog {
4848
bool ignore_if_exists) override;
4949

5050
Result<std::vector<std::string>> ListDatabases() const override;
51-
Result<std::vector<std::string>> ListTables(const std::string& database_names) const override;
52-
Result<bool> DataBaseExists(const std::string& db_name) const override;
51+
Result<std::vector<std::string>> ListTables(const std::string& db_name) const override;
52+
Result<bool> DatabaseExists(const std::string& db_name) const override;
5353
Result<bool> TableExists(const Identifier& identifier) const override;
5454
Result<std::shared_ptr<Schema>> LoadTableSchema(const Identifier& identifier) const override;
5555

src/paimon/core/catalog/file_system_catalog_test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
namespace paimon::test {
3434

35-
TEST(FileSystemCatalogTest, TestDataBaseExists) {
35+
TEST(FileSystemCatalogTest, TestDatabaseExists) {
3636
std::map<std::string, std::string> options;
3737
options[Options::FILE_SYSTEM] = "local";
3838
options[Options::FILE_FORMAT] = "orc";
@@ -41,14 +41,14 @@ TEST(FileSystemCatalogTest, TestDataBaseExists) {
4141
ASSERT_TRUE(dir);
4242
FileSystemCatalog catalog(core_options.GetFileSystem(), dir->Str());
4343

44-
ASSERT_OK_AND_ASSIGN(auto exist, catalog.DataBaseExists("db1"));
44+
ASSERT_OK_AND_ASSIGN(auto exist, catalog.DatabaseExists("db1"));
4545
ASSERT_FALSE(exist);
4646

4747
ASSERT_OK(catalog.CreateDatabase("db1", options, /*ignore_if_exists=*/false));
4848
ASSERT_NOK(catalog.CreateDatabase("db1", options, /*ignore_if_exists=*/false));
4949
ASSERT_OK(catalog.CreateDatabase("db1", options, /*ignore_if_exists=*/true));
5050

51-
ASSERT_OK_AND_ASSIGN(exist, catalog.DataBaseExists("db1"));
51+
ASSERT_OK_AND_ASSIGN(exist, catalog.DatabaseExists("db1"));
5252
ASSERT_TRUE(exist);
5353
ASSERT_OK_AND_ASSIGN(std::vector<std::string> db_names, catalog.ListDatabases());
5454
ASSERT_EQ(1, db_names.size());

0 commit comments

Comments
 (0)