diff --git a/extension/fts/src/catalog/fts_index_catalog_entry.cpp b/extension/fts/src/catalog/fts_index_catalog_entry.cpp index e4c5df94bff..1c80713dc43 100644 --- a/extension/fts/src/catalog/fts_index_catalog_entry.cpp +++ b/extension/fts/src/catalog/fts_index_catalog_entry.cpp @@ -37,7 +37,9 @@ std::string FTSIndexAuxInfo::toCypher(const catalog::IndexCatalogEntry& indexEnt main::ClientContext* context) { std::string cypher; auto catalog = context->getCatalog(); - auto tableName = catalog->getTableCatalogEntry(context->getTransaction(), indexEntry.getTableID())->getName(); + auto tableName = + catalog->getTableCatalogEntry(context->getTransaction(), indexEntry.getTableID()) + ->getName(); std::string propertyStr; for (auto i = 0u; i < properties.size(); i++) { propertyStr += diff --git a/extension/fts/src/function/query_fts_bind_data.cpp b/extension/fts/src/function/query_fts_bind_data.cpp index d847fd7afbf..068dd2200a3 100644 --- a/extension/fts/src/function/query_fts_bind_data.cpp +++ b/extension/fts/src/function/query_fts_bind_data.cpp @@ -1,8 +1,8 @@ #include "function/query_fts_bind_data.h" #include "binder/expression/expression_util.h" -#include "catalog/fts_index_catalog_entry.h" #include "catalog/catalog_entry/table_catalog_entry.h" +#include "catalog/fts_index_catalog_entry.h" #include "common/string_utils.h" #include "function/fts_utils.h" #include "function/stem.h" @@ -58,7 +58,9 @@ struct StopWordsChecker { StopWordsChecker::StopWordsChecker(main::ClientContext& context) : termsVector{LogicalType::STRING(), context.getMemoryManager()}, tx{context.getTransaction()} { termsVector.state = common::DataChunkState::getSingleValueDataChunkState(); - auto tableID = context.getCatalog()->getTableCatalogEntry(tx, FTSUtils::getStopWordsTableName())->getTableID(); + auto tableID = context.getCatalog() + ->getTableCatalogEntry(tx, FTSUtils::getStopWordsTableName()) + ->getTableID(); stopWordsTable = context.getStorageManager()->getTable(tableID)->ptrCast(); } diff --git a/src/binder/bind_expression/bind_function_expression.cpp b/src/binder/bind_expression/bind_function_expression.cpp index 20bde19c5ef..9f6099da37b 100644 --- a/src/binder/bind_expression/bind_function_expression.cpp +++ b/src/binder/bind_expression/bind_function_expression.cpp @@ -239,7 +239,8 @@ std::shared_ptr ExpressionBinder::bindEndNodeExpression(const Expres return rel.getDstNode(); } -static std::vector> populateLabelValues(std::vector entries) { +static std::vector> populateLabelValues( + std::vector entries) { std::unordered_map map; common::table_id_t maxTableID = 0; for (auto& entry : entries) { diff --git a/src/catalog/catalog.cpp b/src/catalog/catalog.cpp index 1c4bc210fdc..ad7a367d646 100644 --- a/src/catalog/catalog.cpp +++ b/src/catalog/catalog.cpp @@ -254,8 +254,7 @@ void Catalog::alterTableEntry(Transaction* transaction, const BoundAlterInfo& in tables->alterEntry(transaction, info); } -bool Catalog::containsSequence(const Transaction* transaction, - const std::string& name) const { +bool Catalog::containsSequence(const Transaction* transaction, const std::string& name) const { return sequences->containsEntry(transaction, name); } diff --git a/src/catalog/catalog_entry/hnsw_index_catalog_entry.cpp b/src/catalog/catalog_entry/hnsw_index_catalog_entry.cpp index f5f75d80c68..c0432d3d68b 100644 --- a/src/catalog/catalog_entry/hnsw_index_catalog_entry.cpp +++ b/src/catalog/catalog_entry/hnsw_index_catalog_entry.cpp @@ -44,7 +44,9 @@ std::string HNSWIndexAuxInfo::toCypher(const IndexCatalogEntry& indexEntry, main::ClientContext* context) { std::string cypher; auto catalog = context->getCatalog(); - auto tableName = catalog->getTableCatalogEntry(context->getTransaction(), indexEntry.getTableID())->getName(); + auto tableName = + catalog->getTableCatalogEntry(context->getTransaction(), indexEntry.getTableID()) + ->getName(); auto distFuncName = storage::HNSWIndexConfig::distFuncToString(config.distFunc); cypher += common::stringFormat("CALL CREATE_HNSW_INDEX('{}', '{}', '{}', mu := {}, ml := {}, " "pu := {}, distFunc := '{}', alpha := {}, efc := {});\n", diff --git a/src/catalog/catalog_entry/rel_group_catalog_entry.cpp b/src/catalog/catalog_entry/rel_group_catalog_entry.cpp index 5ebe80a0697..843468476b6 100644 --- a/src/catalog/catalog_entry/rel_group_catalog_entry.cpp +++ b/src/catalog/catalog_entry/rel_group_catalog_entry.cpp @@ -79,8 +79,10 @@ static std::string getFromToStr(common::table_id_t tableID, ClientContext* conte auto transaction = context->getTransaction(); auto& entry = catalog->getTableCatalogEntry(transaction, tableID)->constCast(); - auto srcTableName = catalog->getTableCatalogEntry(transaction, entry.getSrcTableID())->getName(); - auto dstTableName = catalog->getTableCatalogEntry(transaction, entry.getDstTableID())->getName(); + auto srcTableName = + catalog->getTableCatalogEntry(transaction, entry.getSrcTableID())->getName(); + auto dstTableName = + catalog->getTableCatalogEntry(transaction, entry.getDstTableID())->getName(); return stringFormat("FROM {} TO {}", srcTableName, dstTableName); } diff --git a/src/function/table/call/hnsw/create_hnsw_index.cpp b/src/function/table/call/hnsw/create_hnsw_index.cpp index 45e9b9d3239..e8573744a5a 100644 --- a/src/function/table/call/hnsw/create_hnsw_index.cpp +++ b/src/function/table/call/hnsw/create_hnsw_index.cpp @@ -83,16 +83,23 @@ static void finalizeFunc(const processor::ExecutionContext* context, const auto bindData = hnswSharedState->bindData->constPtrCast(); const auto catalog = clientContext->getCatalog(); - auto upperRelTableID = catalog->getTableCatalogEntry(transaction, - storage::HNSWIndexUtils::getUpperGraphTableName(bindData->indexName))->getTableID(); - auto lowerRelTableID = catalog->getTableCatalogEntry(transaction, - storage::HNSWIndexUtils::getLowerGraphTableName(bindData->indexName))->getTableID(); + auto upperRelTableID = + catalog + ->getTableCatalogEntry(transaction, + storage::HNSWIndexUtils::getUpperGraphTableName(bindData->indexName)) + ->getTableID(); + auto lowerRelTableID = + catalog + ->getTableCatalogEntry(transaction, + storage::HNSWIndexUtils::getLowerGraphTableName(bindData->indexName)) + ->getTableID(); auto auxInfo = std::make_unique(upperRelTableID, lowerRelTableID, hnswSharedState->nodeTable.getColumn(bindData->columnID).getName(), index->getUpperEntryPoint(), index->getLowerEntryPoint(), bindData->config.copy()); - auto indexEntry = std::make_unique(catalog::HNSWIndexCatalogEntry::TYPE_NAME, - bindData->tableEntry->getTableID(), bindData->indexName, std::move(auxInfo)); - catalog->createIndex(transaction,std::move(indexEntry)); + auto indexEntry = + std::make_unique(catalog::HNSWIndexCatalogEntry::TYPE_NAME, + bindData->tableEntry->getTableID(), bindData->indexName, std::move(auxInfo)); + catalog->createIndex(transaction, std::move(indexEntry)); } static std::string createHNSWIndexTables(main::ClientContext& context, diff --git a/src/function/table/call/table_info.cpp b/src/function/table/call/table_info.cpp index f67925c075b..3f408381f2a 100644 --- a/src/function/table/call/table_info.cpp +++ b/src/function/table/call/table_info.cpp @@ -81,7 +81,9 @@ static std::unique_ptr getTableCatalogEntry(const main::Clien throw common::RuntimeException{ common::stringFormat("Database: {} doesn't exist.", catalogName)}; } - return attachedDatabase->getCatalog()->getTableCatalogEntry(transaction, attachedTableName)->copy(); + return attachedDatabase->getCatalog() + ->getTableCatalogEntry(transaction, attachedTableName) + ->copy(); } } diff --git a/src/storage/index/index_utils.cpp b/src/storage/index/index_utils.cpp index 959654476e4..40d1682f588 100644 --- a/src/storage/index/index_utils.cpp +++ b/src/storage/index/index_utils.cpp @@ -8,19 +8,21 @@ namespace kuzu { namespace storage { -static void validateIndexExistence(const main::ClientContext& context, catalog::TableCatalogEntry* tableEntry, - const std::string& indexName, IndexOperation indexOperation) { +static void validateIndexExistence(const main::ClientContext& context, + catalog::TableCatalogEntry* tableEntry, const std::string& indexName, + IndexOperation indexOperation) { switch (indexOperation) { case IndexOperation::CREATE: { - if (context.getCatalog()->containsIndex(context.getTransaction(), tableEntry->getTableID(), indexName)) { - throw common::BinderException{ - common::stringFormat("Index {} already exists in table {}.", indexName, - tableEntry->getName())}; + if (context.getCatalog()->containsIndex(context.getTransaction(), tableEntry->getTableID(), + indexName)) { + throw common::BinderException{common::stringFormat( + "Index {} already exists in table {}.", indexName, tableEntry->getName())}; } } break; case IndexOperation::DROP: case IndexOperation::QUERY: { - if (!context.getCatalog()->containsIndex(context.getTransaction(), tableEntry->getTableID(), indexName)) { + if (!context.getCatalog()->containsIndex(context.getTransaction(), tableEntry->getTableID(), + indexName)) { throw common::BinderException{common::stringFormat( "Table {} doesn't have an index with name {}.", tableEntry->getName(), indexName)}; } diff --git a/test/storage/rel_scan_test.cpp b/test/storage/rel_scan_test.cpp index d027021bb31..6a4b4291372 100644 --- a/test/storage/rel_scan_test.cpp +++ b/test/storage/rel_scan_test.cpp @@ -2,6 +2,8 @@ #include #include "catalog/catalog.h" +#include "catalog/catalog_entry/node_table_catalog_entry.h" +#include "catalog/catalog_entry/rel_table_catalog_entry.h" #include "common/types/date_t.h" #include "common/types/ku_string.h" #include "common/types/types.h" @@ -9,8 +11,6 @@ #include "graph/on_disk_graph.h" #include "main/client_context.h" #include "main_test_helper/private_main_test_helper.h" -#include "catalog/catalog_entry/node_table_catalog_entry.h" -#include "catalog/catalog_entry/rel_table_catalog_entry.h" namespace kuzu {