Skip to content

Commit 55828f8

Browse files
suxiaogang223claude
andcommitted
fix: handle empty partitions result in integration test
sys.partitions returns empty result for unpartitioned tables. CollectResult returns null shared_ptr when no batches are produced. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e2d0b07 commit 55828f8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

test/inte/read_inte_test.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3583,12 +3583,11 @@ TEST(SystemTableReadInteTest, TestReadGlobalPartitions) {
35833583
/*ignore_if_exists=*/false));
35843584
ArrowSchemaRelease(&schema);
35853585

3586-
ASSERT_OK_AND_ASSIGN(auto result,
3586+
// Unpartitioned tables are skipped by sys.partitions → empty result.
3587+
// CollectResult returns null shared_ptr when result is empty.
3588+
ASSERT_OK_AND_ASSIGN(auto part_result,
35873589
ReadGlobalSystemTable("partitions", catalog.get(), fs, warehouse, options));
3588-
auto struct_array = SingleStructChunk(result);
3589-
ASSERT_TRUE(struct_array);
3590-
// Unpartitioned tables are skipped, result should be empty
3591-
ASSERT_EQ(struct_array->length(), 0);
3590+
ASSERT_FALSE(part_result.array) << "expected null array for empty partitions result";
35923591
}
35933592

35943593
} // namespace paimon::test

0 commit comments

Comments
 (0)