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

Method SetUp

cpp/src/arrow/array/array_test.cc:4078–4103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4076class TestArrayDataStatistics : public ::testing::Test {
4077 public:
4078 void SetUp() {
4079 valids_ = {1, 0, 1, 1};
4080 row_count_ = static_cast<int64_t>(valids_.size());
4081 null_count_ = std::count(valids_.begin(), valids_.end(), 0);
4082 distinct_count_ = 3.0;
4083 max_byte_width_ = 4.0;
4084 average_byte_width_ = 4.0;
4085 null_buffer_ = *internal::BytesToBits(valids_);
4086 values_ = {1, 0, 3, -4};
4087 min_ = *std::min_element(values_.begin(), values_.end());
4088 max_ = *std::max_element(values_.begin(), values_.end());
4089 values_buffer_ = Buffer::FromVector(values_);
4090 data_ = ArrayData::Make(int32(), values_.size(), {null_buffer_, values_buffer_},
4091 null_count_);
4092 data_->statistics = std::make_shared<ArrayStatistics>();
4093 data_->statistics->row_count = row_count_;
4094 data_->statistics->null_count = null_count_;
4095 data_->statistics->distinct_count = distinct_count_;
4096 data_->statistics->max_byte_width = max_byte_width_;
4097 data_->statistics->average_byte_width = average_byte_width_;
4098 data_->statistics->is_average_byte_width_exact = true;
4099 data_->statistics->min = min_;
4100 data_->statistics->is_min_exact = true;
4101 data_->statistics->max = max_;
4102 data_->statistics->is_max_exact = true;
4103 }
4104
4105 protected:
4106 std::vector<uint8_t> valids_;

Callers

nothing calls this directly

Calls 7

countFunction · 0.85
BytesToBitsFunction · 0.85
FromVectorFunction · 0.85
MakeFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected