| 148 | } |
| 149 | |
| 150 | int64_t Datum::ComputeLogicalNullCount() const { |
| 151 | if (this->kind() == Datum::ARRAY) { |
| 152 | return std::get<std::shared_ptr<ArrayData>>(this->value)->ComputeLogicalNullCount(); |
| 153 | } else if (this->kind() == Datum::CHUNKED_ARRAY) { |
| 154 | return std::get<std::shared_ptr<ChunkedArray>>(this->value) |
| 155 | ->ComputeLogicalNullCount(); |
| 156 | } else if (this->kind() == Datum::SCALAR) { |
| 157 | const auto& val = *std::get<std::shared_ptr<Scalar>>(this->value); |
| 158 | return val.IsLogicalNull() ? 1 : 0; |
| 159 | } else { |
| 160 | DCHECK(false) << "This function only valid for scalar or array-like values"; |
| 161 | return 0; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | ArrayVector Datum::chunks() const { |
| 166 | if (!this->is_arraylike()) { |