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

Method Decode

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 15

BytesForBitsFunction · 0.85
GetArrayViewFunction · 0.85
resizeMethod · 0.80
SetBitToFunction · 0.50
MakeFunction · 0.50
MakeBuilderFunction · 0.50
ARROW_ASSIGN_OR_RAISEFunction · 0.50
mutable_dataMethod · 0.45
dataMethod · 0.45
idMethod · 0.45
ReserveMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected