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

Method SetUp

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

Source from the content-addressed store, hash-verified

4153class TestArrayDataStatistics : public ::testing::Test {
4154 public:
4155 void SetUp() {
4156 valids_ = {1, 0, 1, 1};
4157 row_count_ = static_cast<int64_t>(valids_.size());
4158 null_count_ = std::count(valids_.begin(), valids_.end(), 0);
4159 distinct_count_ = 3.0;
4160 max_byte_width_ = 4.0;
4161 average_byte_width_ = 4.0;
4162 null_buffer_ = *internal::BytesToBits(valids_);
4163 values_ = {1, 0, 3, -4};
4164 min_ = *std::min_element(values_.begin(), values_.end());
4165 max_ = *std::max_element(values_.begin(), values_.end());
4166 values_buffer_ = Buffer::FromVector(values_);
4167 data_ = ArrayData::Make(int32(), values_.size(), {null_buffer_, values_buffer_},
4168 null_count_);
4169 data_->statistics = std::make_shared<ArrayStatistics>();
4170 data_->statistics->row_count = row_count_;
4171 data_->statistics->null_count = null_count_;
4172 data_->statistics->distinct_count = distinct_count_;
4173 data_->statistics->max_byte_width = max_byte_width_;
4174 data_->statistics->average_byte_width = average_byte_width_;
4175 data_->statistics->is_average_byte_width_exact = true;
4176 data_->statistics->min = min_;
4177 data_->statistics->is_min_exact = true;
4178 data_->statistics->max = max_;
4179 data_->statistics->is_max_exact = true;
4180 }
4181
4182 protected:
4183 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