Skip to content

Commit 4d24776

Browse files
committed
fix2
1 parent 2a0c49f commit 4d24776

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

include/paimon/defs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ struct PAIMON_EXPORT Options {
284284
static const char BLOB_AS_DESCRIPTOR[];
285285
/// "global-index.enabled" - Whether to enable global index for scan. Default value is "true".
286286
static const char GLOBAL_INDEX_ENABLED[];
287-
/// "global-index.external-path" - The external path where the global index will be
288-
/// written.
287+
/// "global-index.external-path" - Global index root directory, if not set, the global index
288+
/// files will be stored under the <table-root-directory>/index.
289289
static const char GLOBAL_INDEX_EXTERNAL_PATH[];
290290
};
291291

src/paimon/core/utils/file_store_path_factory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ std::unique_ptr<IndexPathFactory> FileStorePathFactory::CreateGlobalIndexFileFac
157157
std::string NewPath() const override {
158158
return factory_->NewIndexFile();
159159
}
160+
160161
std::string ToPath(const std::shared_ptr<IndexFileMeta>& file) const override {
161162
const auto& external_path = file->ExternalPath();
162163
if (external_path) {
@@ -168,7 +169,7 @@ std::unique_ptr<IndexPathFactory> FileStorePathFactory::CreateGlobalIndexFileFac
168169
std::string ToPath(const std::string& file_name) const override {
169170
const auto& external_path = factory_->GetGlobalIndexExternalPath();
170171
if (external_path) {
171-
return PathUtil::JoinPath(factory_->IndexPath(external_path.value()), file_name);
172+
return PathUtil::JoinPath(external_path.value(), file_name);
172173
}
173174
return PathUtil::JoinPath(factory_->IndexPath(factory_->RootPath()), file_name);
174175
}

src/paimon/core/utils/file_store_path_factory_test.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,15 @@ TEST_F(FileStorePathFactoryTest, TestCreateIndexFileFactory) {
481481
ASSERT_OK_AND_ASSIGN(
482482
auto index_path_factory,
483483
file_store_path_factory->CreateIndexFileFactory(partition, /*bucket=*/2));
484-
ASSERT_EQ(index_path_factory->ToPath("bitmap.index"),
485-
"/tmp/external-path/index/bitmap.index");
484+
ASSERT_EQ(index_path_factory->ToPath("bitmap.index"), "/tmp/external-path/bitmap.index");
486485
ASSERT_TRUE(index_path_factory->IsExternalPath());
487486

488487
auto index_file_meta = std::make_shared<IndexFileMeta>(
489488
/*index_type=*/"bitmap", /*file_name=*/"bitmap.index", /*file_size=*/10,
490489
/*row_count=*/5, /*dv_ranges=*/std::nullopt,
491-
/*external_path=*/"/tmp/external-path/index/bitmap.index",
490+
/*external_path=*/"/tmp/external-path/bitmap.index",
492491
/*global_index_meta=*/std::nullopt);
493-
ASSERT_EQ(index_path_factory->ToPath(index_file_meta),
494-
"/tmp/external-path/index/bitmap.index");
492+
ASSERT_EQ(index_path_factory->ToPath(index_file_meta), "/tmp/external-path/bitmap.index");
495493
}
496494
}
497495
} // namespace paimon::test

0 commit comments

Comments
 (0)