MCPcopy Create free account
hub / github.com/apache/arrow / Decode

Method Decode

cpp/src/arrow/compute/row/row_encoder_internal.cc:114–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114Result<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
135void FixedWidthKeyEncoder::AddLength(const ExecValue&, int64_t batch_length,
136 int32_t* lengths) {

Callers

nothing calls this directly

Calls 10

BytesForBitsFunction · 0.85
GetArrayViewFunction · 0.85
resizeMethod · 0.80
SetBitToFunction · 0.50
MakeFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50
mutable_dataMethod · 0.45
dataMethod · 0.45
idMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected