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

Function AppendNumericBatchCast

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

Source from the content-addressed store, hash-verified

151
152template <class BuilderType, class TargetType, class BatchType, class SourceType>
153Status AppendNumericBatchCast(liborc::ColumnVectorBatch* column_vector_batch,
154 int64_t offset, int64_t length, ArrayBuilder* abuilder) {
155 auto builder = checked_cast<BuilderType*>(abuilder);
156 auto batch = checked_cast<BatchType*>(column_vector_batch);
157
158 if (length == 0) {
159 return Status::OK();
160 }
161
162 const uint8_t* valid_bytes = nullptr;
163 if (batch->hasNulls) {
164 valid_bytes = reinterpret_cast<const uint8_t*>(batch->notNull.data()) + offset;
165 }
166 const SourceType* source = batch->data.data() + offset;
167 auto cast_iter = internal::MakeLazyRange(
168 [&source](int64_t index) { return static_cast<TargetType>(source[index]); },
169 length);
170
171 RETURN_NOT_OK(builder->AppendValues(cast_iter.begin(), cast_iter.end(), valid_bytes));
172
173 return Status::OK();
174}
175
176Status AppendBoolBatch(liborc::ColumnVectorBatch* column_vector_batch, int64_t offset,
177 int64_t length, ArrayBuilder* abuilder) {

Callers

nothing calls this directly

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