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

Function AppendBatch

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

Source from the content-addressed store, hash-verified

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

Callers 7

TestUnionConversionFunction · 0.85
ReadNextMethod · 0.85
ReadBatchMethod · 0.85
AppendStructBatchFunction · 0.85
AppendListBatchFunction · 0.85
AppendMapBatchFunction · 0.85
AppendUnionBatchInternalFunction · 0.85

Calls 9

AppendStructBatchFunction · 0.85
AppendListBatchFunction · 0.85
AppendMapBatchFunction · 0.85
AppendBoolBatchFunction · 0.85
AppendTimestampBatchFunction · 0.85
AppendDecimalBatchFunction · 0.85
AppendUnionBatchFunction · 0.85
OKFunction · 0.50
NotImplementedFunction · 0.50

Tested by 1

TestUnionConversionFunction · 0.68