| 151 | |
| 152 | template <class BuilderType, class TargetType, class BatchType, class SourceType> |
| 153 | Status 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 | |
| 176 | Status AppendBoolBatch(liborc::ColumnVectorBatch* column_vector_batch, int64_t offset, |
| 177 | int64_t length, ArrayBuilder* abuilder) { |
nothing calls this directly
no test coverage detected