| 112 | } |
| 113 | |
| 114 | Result<std::shared_ptr<ArrayData>> BooleanKeyEncoder::Decode(uint8_t** encoded_bytes, |
| 115 | int32_t length, |
| 116 | MemoryPool* pool) { |
| 117 | std::shared_ptr<Buffer> null_buf; |
| 118 | int32_t null_count; |
| 119 | RETURN_NOT_OK(DecodeNulls(pool, length, encoded_bytes, &null_buf, &null_count)); |
| 120 | |
| 121 | ARROW_ASSIGN_OR_RAISE(auto key_buf, AllocateBitmap(length, pool)); |
| 122 | |
| 123 | uint8_t* raw_output = key_buf->mutable_data(); |
| 124 | memset(raw_output, 0, bit_util::BytesForBits(length)); |
| 125 | for (int32_t i = 0; i < length; ++i) { |
| 126 | auto& encoded_ptr = encoded_bytes[i]; |
| 127 | bit_util::SetBitTo(raw_output, i, encoded_ptr[0] != 0); |
| 128 | encoded_ptr += 1; |
| 129 | } |
| 130 | |
| 131 | return ArrayData::Make(boolean(), length, {std::move(null_buf), std::move(key_buf)}, |
| 132 | null_count); |
| 133 | } |
| 134 | |
| 135 | void FixedWidthKeyEncoder::AddLength(const ExecValue&, int64_t batch_length, |
| 136 | int32_t* lengths) { |
nothing calls this directly
no test coverage detected