Skip to content

Commit 21edd0f

Browse files
authored
Merge branch 'main' into duanyan/remap_predicate_field_index
2 parents 1addb37 + 8f996d3 commit 21edd0f

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

src/paimon/core/operation/file_store_commit.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ Result<std::unique_ptr<FileStoreCommit>> FileStoreCommit::Create(
8181
assert(options.GetFileSystem());
8282
assert(options.GetFileFormat());
8383
PAIMON_ASSIGN_OR_RAISE(bool is_object_store, FileSystem::IsObjectStore(root_path));
84-
if (is_object_store && opts.find("enable-object-store-commit-in-inte-test") == opts.end()) {
84+
if (is_object_store && !ctx->UseRESTCatalogCommit() &&
85+
opts.find("enable-object-store-commit-in-inte-test") == opts.end()) {
8586
return Status::NotImplemented(
8687
"commit operation does not support object store file system for now");
8788
}

src/paimon/core/operation/file_store_commit_impl_test.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,4 +1661,31 @@ TEST_F(FileStoreCommitImplTest, TestCommitWithIOException) {
16611661
ASSERT_TRUE(commit_run_complete);
16621662
}
16631663

1664+
TEST_F(FileStoreCommitImplTest, TestObjectStoreAllowedWithRESTCatalogCommit) {
1665+
// Verify: the object store check in FileStoreCommit::Create is skipped when
1666+
// UseRESTCatalogCommit is true. We can't use an actual oss:// path in unit
1667+
// tests (LocalFileSystem rejects the scheme), but we verify the condition
1668+
// by confirming that the "enable-object-store-commit-in-inte-test" flag is
1669+
// not needed when UseRESTCatalogCommit is enabled. End-to-end oss:// testing
1670+
// is covered by duckdb-paimon integration tests.
1671+
ASSERT_OK_AND_ASSIGN(bool is_oss, FileSystem::IsObjectStore("oss://bucket/path"));
1672+
ASSERT_TRUE(is_oss);
1673+
1674+
// REST commit with local path should work without the object store flag
1675+
CommitContextBuilder builder(table_path_, "commit_user_1");
1676+
ASSERT_OK_AND_ASSIGN(
1677+
auto ctx,
1678+
builder.AddOption(Options::MANIFEST_FORMAT, "orc").UseRESTCatalogCommit(true).Finish());
1679+
ASSERT_OK_AND_ASSIGN(auto commit, FileStoreCommit::Create(std::move(ctx)));
1680+
1681+
auto msgs =
1682+
GetCommitMessages(paimon::test::GetDataDir() +
1683+
"/orc/append_09.db/append_09/commit_messages/commit_messages-01",
1684+
3);
1685+
ASSERT_GT(msgs.size(), 0);
1686+
ASSERT_OK(commit->Commit(msgs));
1687+
ASSERT_OK_AND_ASSIGN(auto json, commit->GetLastCommitTableRequest());
1688+
ASSERT_FALSE(json.empty());
1689+
}
1690+
16641691
} // namespace paimon::test

0 commit comments

Comments
 (0)