| 1665 | |
| 1666 | void Put(const T* buffer, int num_values) override; |
| 1667 | void Put(const ::arrow::Array& values) override { |
| 1668 | if (values.type_id() != ::arrow::Type::BOOL) { |
| 1669 | throw ParquetException("RleBooleanEncoder expects BooleanArray, got ", |
| 1670 | values.type()->ToString()); |
| 1671 | } |
| 1672 | const auto& boolean_array = checked_cast<const ::arrow::BooleanArray&>(values); |
| 1673 | if (values.null_count() == 0) { |
| 1674 | for (int i = 0; i < boolean_array.length(); ++i) { |
| 1675 | // null_count == 0, so just call Value directly is ok. |
| 1676 | buffered_append_values_.push_back(boolean_array.Value(i)); |
| 1677 | } |
| 1678 | } else { |
| 1679 | PARQUET_THROW_NOT_OK(::arrow::VisitArraySpanInline<::arrow::BooleanType>( |
| 1680 | *boolean_array.data(), |
| 1681 | [&](bool value) { |
| 1682 | buffered_append_values_.push_back(value); |
| 1683 | return Status::OK(); |
| 1684 | }, |
| 1685 | []() { return Status::OK(); })); |
| 1686 | } |
| 1687 | } |
| 1688 | |
| 1689 | void PutSpaced(const T* src, int num_values, const uint8_t* valid_bits, |
| 1690 | int64_t valid_bits_offset) override { |
nothing calls this directly
no test coverage detected