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

Function TEST

cpp/src/parquet/size_statistics_test.cc:42–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40namespace parquet {
41
42TEST(SizeStatistics, UpdateLevelHistogram) {
43 {
44 // max_level = 1
45 std::vector<int64_t> histogram(2, 0);
46 UpdateLevelHistogram(std::vector<int16_t>{0, 1, 1, 1, 0}, histogram);
47 EXPECT_THAT(histogram, ::testing::ElementsAre(2, 3));
48 UpdateLevelHistogram(std::vector<int16_t>{1, 1, 0}, histogram);
49 EXPECT_THAT(histogram, ::testing::ElementsAre(3, 5));
50 UpdateLevelHistogram(std::vector<int16_t>{}, histogram);
51 EXPECT_THAT(histogram, ::testing::ElementsAre(3, 5));
52 }
53 {
54 // max_level > 1
55 std::vector<int64_t> histogram(3, 0);
56 UpdateLevelHistogram(std::vector<int16_t>{0, 1, 2, 2, 0}, histogram);
57 EXPECT_THAT(histogram, ::testing::ElementsAre(2, 1, 2));
58 UpdateLevelHistogram(std::vector<int16_t>{1, 1, 0}, histogram);
59 EXPECT_THAT(histogram, ::testing::ElementsAre(3, 3, 2));
60 UpdateLevelHistogram(std::vector<int16_t>{}, histogram);
61 EXPECT_THAT(histogram, ::testing::ElementsAre(3, 3, 2));
62 }
63}
64
65TEST(SizeStatistics, ThriftSerDe) {
66 const std::vector<int64_t> kDefLevels = {128, 64, 32, 16};

Callers

nothing calls this directly

Calls 9

UpdateLevelHistogramFunction · 0.85
ByteArrayClass · 0.85
ToThriftFunction · 0.85
FromThriftFunction · 0.85
physical_typeMethod · 0.80
MakeFunction · 0.70
getMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected