| 153 | |
| 154 | template <typename Container> |
| 155 | void FillBuffer(const QuantileOptions& options, const Container& container, |
| 156 | int64_t length, int64_t null_count, |
| 157 | std::vector<CType, Allocator>* in_buffer) { |
| 158 | int64_t in_length = 0; |
| 159 | if ((!options.skip_nulls && null_count > 0) || |
| 160 | (length - null_count < options.min_count)) { |
| 161 | in_length = 0; |
| 162 | } else { |
| 163 | in_length = length - null_count; |
| 164 | } |
| 165 | |
| 166 | if (in_length > 0) { |
| 167 | in_buffer->resize(in_length); |
| 168 | CopyNonNullValues(container, in_buffer->data()); |
| 169 | |
| 170 | // drop nan |
| 171 | if (is_floating_type<InType>::value) { |
| 172 | const auto& it = std::remove_if(in_buffer->begin(), in_buffer->end(), |
| 173 | [](CType v) { return v != v; }); |
| 174 | in_buffer->resize(it - in_buffer->begin()); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | Status Exec(KernelContext* ctx, const ArraySpan& values, ExecResult* out) { |
| 180 | const QuantileOptions& options = QuantileState::Get(ctx); |
nothing calls this directly
no test coverage detected