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

Function AppendNumericBatchCast

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

Source from the content-addressed store, hash-verified

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