Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
set_option_category("Test")

define_option(PAIMON_BUILD_TESTS "Build the Paimon googletest unit tests" OFF)
define_option(PAIMON_BUILD_EXAMPLE "Build the Paimon example" OFF)

if(PAIMON_BUILD_SHARED)
set(PAIMON_TEST_LINKAGE_DEFAULT "shared")
Expand Down
4 changes: 4 additions & 0 deletions src/paimon/core/global_index/indexed_split_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ TEST(IndexedSplitTest, TestIndexedSplitWithScore) {
std::make_shared<IndexedSplitImpl>(expected_data_split, ranges, scores);

ASSERT_EQ(*result_indexed_split, *expected_indexed_split) << result_indexed_split->ToString();
ASSERT_TRUE(
result_indexed_split->ToString().find(
"rowRanges=[[55, 56],[270, 270],[1001, 1002]], scores=[1.01,2.1,-1.32,4.23,50.74]") !=
std::string::npos);
ASSERT_OK_AND_ASSIGN(std::string serialize_bytes, Split::Serialize(result_indexed_split, pool));
ASSERT_EQ(serialize_bytes,
std::string(reinterpret_cast<char*>(split_bytes.data()), split_bytes.size()));
Expand Down
2 changes: 1 addition & 1 deletion src/paimon/format/orc/complex_predicate_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ComplexPredicateTest : public ::testing::Test {
TEST_F(ComplexPredicateTest, TestSimple) {
std::string file_name = paimon::test::GetDataDir() +
"/orc/append_complex_data.db/append_complex_data/f1=10/bucket-0/"
"data-05b19a2d-18d8-4620-b8ab-cd8f862d96d1-0.orc";
"data-14a30421-7650-486c-9876-66a1fa4356ff-0.orc";
arrow::FieldVector fields = {
arrow::field("f1", arrow::int32()),
arrow::field("f2", arrow::int32()),
Expand Down
3 changes: 3 additions & 0 deletions src/paimon/format/orc/orc_file_batch_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ Result<::orc::RowReaderOptions> OrcFileBatchReader::CreateRowReaderOptions(
include_fields.push_back(field_name);
}
row_reader_options.include(include_fields);
// In order to avoid issue like https://github.com/alibaba/paimon-cpp/issues/42, we explicitly
// set GMT timezone.
row_reader_options.setTimezoneName("GMT");
row_reader_options.searchArgument(std::move(search_arg));

PAIMON_ASSIGN_OR_RAISE(
Expand Down
2 changes: 1 addition & 1 deletion src/paimon/format/orc/orc_file_batch_reader_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ TEST_F(OrcFileBatchReaderTest, TestNextBatchWithDictionary) {
TEST_P(OrcFileBatchReaderTest, TestComplexType) {
std::string file_name = paimon::test::GetDataDir() +
"/orc/append_complex_data.db/append_complex_data/f1=10/bucket-0/"
"data-05b19a2d-18d8-4620-b8ab-cd8f862d96d1-0.orc";
"data-14a30421-7650-486c-9876-66a1fa4356ff-0.orc";
arrow::FieldVector fields = {arrow::field("f1", arrow::int32()),
arrow::field("f2", arrow::int32()),
arrow::field("f3", arrow::date32()),
Expand Down
3 changes: 3 additions & 0 deletions src/paimon/format/orc/orc_format_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ Result<::orc::WriterOptions> OrcFormatWriter::PrepareWriterOptions(
OptionsUtils::GetValueFromMap<size_t>(options, ORC_ROW_INDEX_STRIDE,
DEFAULT_ROW_INDEX_STRIDE));
writer_options.setRowIndexStride(row_index_stride);
// In order to avoid issue like https://github.com/alibaba/paimon-cpp/issues/42, we explicitly
// set GMT timezone.
writer_options.setTimezoneName("GMT");
return writer_options;
}

Expand Down
21 changes: 21 additions & 0 deletions test/inte/global_index_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,27 @@ TEST_P(GlobalIndexTest, TestScanIndex) {
ASSERT_OK_AND_ASSIGN(auto index_result, evaluator->Evaluate(predicate));
ASSERT_EQ(index_result.value()->ToString(), "{0,1,2,3,4,5,6,7}");
}
{
// test greater or equal predicate which bitmap index is not support, will return all range
auto predicate = PredicateBuilder::GreaterOrEqual(/*field_index=*/1, /*field_name=*/"f1",
FieldType::INT, Literal(10));
ASSERT_OK_AND_ASSIGN(auto index_result, evaluator->Evaluate(predicate));
ASSERT_EQ(index_result.value()->ToString(), "{0,1,2,3,4,5,6,7}");
}
{
// test less than predicate which bitmap index is not support, will return all range
auto predicate = PredicateBuilder::LessThan(/*field_index=*/1, /*field_name=*/"f1",
FieldType::INT, Literal(10));
ASSERT_OK_AND_ASSIGN(auto index_result, evaluator->Evaluate(predicate));
ASSERT_EQ(index_result.value()->ToString(), "{0,1,2,3,4,5,6,7}");
}
{
// test less or equal predicate which bitmap index is not support, will return all range
auto predicate = PredicateBuilder::LessOrEqual(/*field_index=*/1, /*field_name=*/"f1",
FieldType::INT, Literal(10));
ASSERT_OK_AND_ASSIGN(auto index_result, evaluator->Evaluate(predicate));
ASSERT_EQ(index_result.value()->ToString(), "{0,1,2,3,4,5,6,7}");
}
{
// test a predicate for field with no index
auto f3_predicate = PredicateBuilder::Equal(/*field_index=*/3, /*field_name=*/"f3",
Expand Down
8 changes: 4 additions & 4 deletions test/inte/read_inte_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,9 +630,9 @@ TEST_P(ReadInteTest, TestAppendReadWithComplexTypePredicate) {
std::vector<std::string> file_list_1;
std::vector<std::string> file_list_2;
if (param.file_format == "orc") {
file_list_0 = {"data-05b19a2d-18d8-4620-b8ab-cd8f862d96d1-0.orc"};
file_list_1 = {"data-d336eb91-df17-4932-8206-4199579a2cbd-0.orc"};
file_list_2 = {"data-b35d2ec8-b4a5-4c23-9652-bd8d9fabdee0-0.orc"};
file_list_0 = {"data-14a30421-7650-486c-9876-66a1fa4356ff-0.orc"};
file_list_1 = {"data-d39c4ccc-6245-460c-bd70-632bd2b26234-0.orc"};
file_list_2 = {"data-b20718c4-b2e1-4928-b563-11539edc9572-0.orc"};
} else if (param.file_format == "parquet") {
file_list_0 = {"data-f8754699-0c43-4e53-be00-7e8af1754913-0.parquet"};
file_list_1 = {"data-ac0894ca-fc13-49c8-bb22-4556c8ee416c-0.parquet"};
Expand Down Expand Up @@ -668,7 +668,7 @@ TEST_P(ReadInteTest, TestAppendReadWithComplexTypePredicate) {
&expected_array);
ASSERT_TRUE(array_status.ok());
ASSERT_TRUE(result_array);
ASSERT_TRUE(result_array->Equals(*expected_array));
ASSERT_TRUE(result_array->Equals(*expected_array)) << result_array->ToString();
}

TEST_P(ReadInteTest, TestAppendReadWithPredicateOnlyPushdown) {
Expand Down
8 changes: 4 additions & 4 deletions test/inte/scan_inte_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ TEST_F(ScanInteTest, TestScanAppendComplexDataWithSnapshot4WithPredicateFilter)
// check data splits
auto result_data_splits = CollectDataSplits(result_plan);
auto meta = std::make_shared<DataFileMeta>(
"data-05b19a2d-18d8-4620-b8ab-cd8f862d96d1-0.orc", /*file_size=*/974, /*row_count=*/6,
"data-14a30421-7650-486c-9876-66a1fa4356ff-0.orc", /*file_size=*/1004, /*row_count=*/6,
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
/*key_stats=*/SimpleStats::EmptyStats(),
BinaryRowGenerator::GenerateStats(
Expand All @@ -1242,7 +1242,7 @@ TEST_F(ScanInteTest, TestScanAppendComplexDataWithSnapshot4WithPredicateFilter)
{0, 0, 1, 0, 1, 1}, pool_.get()),
/*min_sequence_number=*/0, /*max_sequence_number=*/5, /*schema_id=*/0,
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1729183876992ll, 0),
/*creation_time=*/Timestamp(1767506722625ll, 0),
/*delete_row_count=*/0, /*embedded_index=*/nullptr, FileSource::Compact(),
/*value_stats_cols=*/std::nullopt, /*external_path=*/std::nullopt,
/*first_row_id=*/std::nullopt,
Expand Down Expand Up @@ -1296,7 +1296,7 @@ TEST_F(ScanInteTest, TestScanAppendComplexDataWithSnapshot4WithPredicateFilter2)
}

auto meta = std::make_shared<DataFileMeta>(
"data-05b19a2d-18d8-4620-b8ab-cd8f862d96d1-0.orc", /*file_size=*/974, /*row_count=*/6,
"data-14a30421-7650-486c-9876-66a1fa4356ff-0.orc", /*file_size=*/1004, /*row_count=*/6,
/*min_key=*/BinaryRow::EmptyRow(), /*max_key=*/BinaryRow::EmptyRow(),
/*key_stats=*/SimpleStats::EmptyStats(),
BinaryRowGenerator::GenerateStats(
Expand All @@ -1308,7 +1308,7 @@ TEST_F(ScanInteTest, TestScanAppendComplexDataWithSnapshot4WithPredicateFilter2)
{0, 0, 1, 0, 1, 1}, pool_.get()),
/*min_sequence_number=*/0, /*max_sequence_number=*/5, /*schema_id=*/0,
/*level=*/0, /*extra_files=*/std::vector<std::optional<std::string>>(),
/*creation_time=*/Timestamp(1729183876992ll, 0),
/*creation_time=*/Timestamp(1767506722625ll, 0),
/*delete_row_count=*/0, /*embedded_index=*/nullptr, FileSource::Compact(),
/*value_stats_cols=*/std::nullopt, /*external_path=*/std::nullopt,
/*first_row_id=*/std::nullopt,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"manifest.format" : "orc",
"file.format" : "orc"
},
"timeMillis" : 1729155073912
"timeMillis" : 1767506720974
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"version" : 3,
"id" : 1,
"schemaId" : 0,
"baseManifestList" : "manifest-list-0e955494-20af-43ff-8886-4a738fd3d517-0",
"deltaManifestList" : "manifest-list-0e955494-20af-43ff-8886-4a738fd3d517-1",
"baseManifestList" : "manifest-list-5496fd48-8429-467e-b48d-0de24ec78a99-0",
"baseManifestListSize" : 392,
"deltaManifestList" : "manifest-list-5496fd48-8429-467e-b48d-0de24ec78a99-1",
"deltaManifestListSize" : 1535,
"changelogManifestList" : null,
"commitUser" : "c83342c0-bb33-4282-bb8c-b07b3033b86e",
"commitUser" : "1a9b901a-ec8e-414b-b546-a26b3c0dcac1",
"commitIdentifier" : 1,
"commitKind" : "APPEND",
"timeMillis" : 1729155076102,
"timeMillis" : 1767506722258,
"logOffsets" : { },
"totalRecordCount" : 3,
"deltaRecordCount" : 3,
"changelogRecordCount" : 0
"changelogRecordCount" : 0,
"nextRowId" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"version" : 3,
"id" : 2,
"schemaId" : 0,
"baseManifestList" : "manifest-list-dd8bb739-7944-4b9f-a146-30ed9f9e27d9-0",
"deltaManifestList" : "manifest-list-dd8bb739-7944-4b9f-a146-30ed9f9e27d9-1",
"baseManifestList" : "manifest-list-392fa32d-34bf-4eef-86be-b31ccf8b7dd5-0",
"baseManifestListSize" : 1535,
"deltaManifestList" : "manifest-list-392fa32d-34bf-4eef-86be-b31ccf8b7dd5-1",
"deltaManifestListSize" : 1548,
"changelogManifestList" : null,
"commitUser" : "c83342c0-bb33-4282-bb8c-b07b3033b86e",
"commitUser" : "1a9b901a-ec8e-414b-b546-a26b3c0dcac1",
"commitIdentifier" : 2,
"commitKind" : "APPEND",
"timeMillis" : 1729155076912,
"timeMillis" : 1767506722553,
"logOffsets" : { },
"totalRecordCount" : 7,
"deltaRecordCount" : 4,
"changelogRecordCount" : 0
"changelogRecordCount" : 0,
"nextRowId" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"version" : 3,
"id" : 3,
"schemaId" : 0,
"baseManifestList" : "manifest-list-7a1c859b-2bd3-4a85-895c-1e16dd63493b-0",
"deltaManifestList" : "manifest-list-7a1c859b-2bd3-4a85-895c-1e16dd63493b-1",
"baseManifestList" : "manifest-list-4e2ee2ad-4258-41ca-8648-60f7481a72e9-0",
"baseManifestListSize" : 1708,
"deltaManifestList" : "manifest-list-4e2ee2ad-4258-41ca-8648-60f7481a72e9-1",
"deltaManifestListSize" : 1551,
"changelogManifestList" : null,
"commitUser" : "c83342c0-bb33-4282-bb8c-b07b3033b86e",
"commitUser" : "1a9b901a-ec8e-414b-b546-a26b3c0dcac1",
"commitIdentifier" : 3,
"commitKind" : "APPEND",
"timeMillis" : 1729155077514,
"timeMillis" : 1767506722711,
"logOffsets" : { },
"totalRecordCount" : 8,
"deltaRecordCount" : 1,
"changelogRecordCount" : 0
"changelogRecordCount" : 0,
"nextRowId" : 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
"version" : 3,
"id" : 4,
"schemaId" : 0,
"baseManifestList" : "manifest-list-7a1c859b-2bd3-4a85-895c-1e16dd63493b-2",
"deltaManifestList" : "manifest-list-7a1c859b-2bd3-4a85-895c-1e16dd63493b-3",
"baseManifestList" : "manifest-list-4e2ee2ad-4258-41ca-8648-60f7481a72e9-2",
"baseManifestListSize" : 1756,
"deltaManifestList" : "manifest-list-4e2ee2ad-4258-41ca-8648-60f7481a72e9-3",
"deltaManifestListSize" : 1547,
"changelogManifestList" : null,
"commitUser" : "c83342c0-bb33-4282-bb8c-b07b3033b86e",
"commitUser" : "1a9b901a-ec8e-414b-b546-a26b3c0dcac1",
"commitIdentifier" : 3,
"commitKind" : "COMPACT",
"timeMillis" : 1729155077559,
"timeMillis" : 1767506722814,
"logOffsets" : { },
"totalRecordCount" : 8,
"deltaRecordCount" : 0,
"changelogRecordCount" : 0
"changelogRecordCount" : 0,
"nextRowId" : 0
}
Loading