MCPcopy Create free account
hub / github.com/apache/arrow / TEST_F

Function TEST_F

cpp/src/parquet/page_index_test.cc:872–906  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870};
871
872TEST_F(PageIndexBuilderTest, SingleRowGroup) {
873 schema::NodePtr root = schema::GroupNode::Make(
874 "schema", Repetition::REPEATED,
875 {schema::ByteArray("c1"), schema::ByteArray("c2"), schema::ByteArray("c3")});
876 schema_.Init(root);
877
878 // Prepare page stats and page locations for single row group.
879 // Note that the 3rd column does not have any stats and its page index is disabled.
880 const int num_row_groups = 1;
881 const int num_columns = 3;
882 const std::vector<std::vector<EncodedStatistics>> page_stats = {
883 /*row_group_id=0*/
884 {/*column_id=0*/ EncodedStatistics().set_null_count(0).set_min("a").set_max("b"),
885 /*column_id=1*/ EncodedStatistics().set_null_count(0).set_min("A").set_max("B")}};
886 const std::vector<std::vector<PageLocation>> page_locations = {
887 /*row_group_id=0*/
888 {/*column_id=0*/ {/*offset=*/128, /*compressed_page_size=*/512,
889 /*first_row_index=*/0},
890 /*column_id=1*/ {/*offset=*/1024, /*compressed_page_size=*/512,
891 /*first_row_index=*/0}}};
892 const int64_t final_position = 200;
893
894 WritePageIndexes(num_row_groups, num_columns, page_stats, page_locations,
895 final_position);
896
897 // Verify that first two columns have good page indexes.
898 for (int column = 0; column < 2; ++column) {
899 CheckColumnIndex(/*row_group=*/0, column, page_stats[0][column]);
900 CheckOffsetIndex(/*row_group=*/0, column, page_locations[0][column], final_position);
901 }
902
903 // Verify the 3rd column does not have page indexes.
904 ASSERT_EQ(nullptr, ReadColumnIndex(/*row_group=*/0, /*column=*/2));
905 ASSERT_EQ(nullptr, ReadOffsetIndex(/*row_group=*/0, /*column=*/2));
906}
907
908TEST_F(PageIndexBuilderTest, TwoRowGroups) {
909 schema::NodePtr root = schema::GroupNode::Make(

Callers

nothing calls this directly

Calls 4

ByteArrayClass · 0.85
EncodedStatisticsClass · 0.85
MakeFunction · 0.70
InitMethod · 0.45

Tested by

no test coverage detected