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

Function AppendBoolBatch

cpp/src/arrow/adapters/orc/util.cc:176–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176Status AppendBoolBatch(liborc::ColumnVectorBatch* column_vector_batch, int64_t offset,
177 int64_t length, ArrayBuilder* abuilder) {
178 auto builder = checked_cast<BooleanBuilder*>(abuilder);
179 auto batch = checked_cast<liborc::LongVectorBatch*>(column_vector_batch);
180
181 if (length == 0) {
182 return Status::OK();
183 }
184
185 const uint8_t* valid_bytes = nullptr;
186 if (batch->hasNulls) {
187 valid_bytes = reinterpret_cast<const uint8_t*>(batch->notNull.data()) + offset;
188 }
189 const int64_t* source = batch->data.data() + offset;
190
191 auto cast_iter = internal::MakeLazyRange(
192 [&source](int64_t index) { return static_cast<bool>(source[index]); }, length);
193
194 RETURN_NOT_OK(builder->AppendValues(cast_iter.begin(), cast_iter.end(), valid_bytes));
195
196 return Status::OK();
197}
198
199Status AppendTimestampBatch(liborc::ColumnVectorBatch* column_vector_batch,
200 int64_t offset, int64_t length, ArrayBuilder* abuilder) {

Callers 1

AppendBatchFunction · 0.85

Calls 6

MakeLazyRangeFunction · 0.85
OKFunction · 0.50
dataMethod · 0.45
AppendValuesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected