| 327 | } // namespace |
| 328 | |
| 329 | Status AppendBatch(const liborc::Type* type, liborc::ColumnVectorBatch* batch, |
| 330 | int64_t offset, int64_t length, ArrayBuilder* builder) { |
| 331 | if (type == nullptr) { |
| 332 | return Status::OK(); |
| 333 | } |
| 334 | liborc::TypeKind kind = type->getKind(); |
| 335 | switch (kind) { |
| 336 | case liborc::STRUCT: |
| 337 | return AppendStructBatch(type, batch, offset, length, builder); |
| 338 | case liborc::LIST: |
| 339 | return AppendListBatch(type, batch, offset, length, builder); |
| 340 | case liborc::MAP: |
| 341 | return AppendMapBatch(type, batch, offset, length, builder); |
| 342 | case liborc::LONG: |
| 343 | return AppendNumericBatch<Int64Builder, liborc::LongVectorBatch, int64_t>( |
| 344 | batch, offset, length, builder); |
| 345 | case liborc::INT: |
| 346 | return AppendNumericBatchCast<Int32Builder, int32_t, liborc::LongVectorBatch, |
| 347 | int64_t>(batch, offset, length, builder); |
| 348 | case liborc::SHORT: |
| 349 | return AppendNumericBatchCast<Int16Builder, int16_t, liborc::LongVectorBatch, |
| 350 | int64_t>(batch, offset, length, builder); |
| 351 | case liborc::BYTE: |
| 352 | return AppendNumericBatchCast<Int8Builder, int8_t, liborc::LongVectorBatch, |
| 353 | int64_t>(batch, offset, length, builder); |
| 354 | case liborc::DOUBLE: |
| 355 | return AppendNumericBatch<DoubleBuilder, liborc::DoubleVectorBatch, double>( |
| 356 | batch, offset, length, builder); |
| 357 | case liborc::FLOAT: |
| 358 | return AppendNumericBatchCast<FloatBuilder, float, liborc::DoubleVectorBatch, |
| 359 | double>(batch, offset, length, builder); |
| 360 | case liborc::BOOLEAN: |
| 361 | return AppendBoolBatch(batch, offset, length, builder); |
| 362 | case liborc::CHAR: |
| 363 | case liborc::VARCHAR: |
| 364 | case liborc::STRING: |
| 365 | return AppendBinaryBatch<StringBuilder>(batch, offset, length, builder); |
| 366 | case liborc::BINARY: |
| 367 | return AppendBinaryBatch<BinaryBuilder>(batch, offset, length, builder); |
| 368 | case liborc::DATE: |
| 369 | return AppendNumericBatchCast<Date32Builder, int32_t, liborc::LongVectorBatch, |
| 370 | int64_t>(batch, offset, length, builder); |
| 371 | case liborc::TIMESTAMP: |
| 372 | case liborc::TIMESTAMP_INSTANT: |
| 373 | return AppendTimestampBatch(batch, offset, length, builder); |
| 374 | case liborc::DECIMAL: |
| 375 | return AppendDecimalBatch(type, batch, offset, length, builder); |
| 376 | case liborc::UNION: |
| 377 | return AppendUnionBatch(type, batch, offset, length, builder); |
| 378 | default: |
| 379 | return Status::NotImplemented("Not implemented type kind: ", kind); |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | namespace { |
| 384 | |