| 4026 | class TestArrayDataStatistics : public ::testing::Test { |
| 4027 | public: |
| 4028 | void SetUp() { |
| 4029 | valids_ = {1, 0, 1, 1}; |
| 4030 | row_count_ = static_cast<int64_t>(valids_.size()); |
| 4031 | null_count_ = std::count(valids_.begin(), valids_.end(), 0); |
| 4032 | distinct_count_ = 3.0; |
| 4033 | max_byte_width_ = 4.0; |
| 4034 | average_byte_width_ = 4.0; |
| 4035 | null_buffer_ = *internal::BytesToBits(valids_); |
| 4036 | values_ = {1, 0, 3, -4}; |
| 4037 | min_ = *std::min_element(values_.begin(), values_.end()); |
| 4038 | max_ = *std::max_element(values_.begin(), values_.end()); |
| 4039 | values_buffer_ = Buffer::FromVector(values_); |
| 4040 | data_ = ArrayData::Make(int32(), values_.size(), {null_buffer_, values_buffer_}, |
| 4041 | null_count_); |
| 4042 | data_->statistics = std::make_shared<ArrayStatistics>(); |
| 4043 | data_->statistics->row_count = row_count_; |
| 4044 | data_->statistics->null_count = null_count_; |
| 4045 | data_->statistics->distinct_count = distinct_count_; |
| 4046 | data_->statistics->max_byte_width = max_byte_width_; |
| 4047 | data_->statistics->average_byte_width = average_byte_width_; |
| 4048 | data_->statistics->is_average_byte_width_exact = true; |
| 4049 | data_->statistics->min = min_; |
| 4050 | data_->statistics->is_min_exact = true; |
| 4051 | data_->statistics->max = max_; |
| 4052 | data_->statistics->is_max_exact = true; |
| 4053 | } |
| 4054 | |
| 4055 | protected: |
| 4056 | std::vector<uint8_t> valids_; |
nothing calls this directly
no test coverage detected