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

Function AppendBatch

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

Source from the content-addressed store, hash-verified

327} // namespace
328
329Status 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
383namespace {
384

Callers 8

TestUnionConversionFunction · 0.85
TESTFunction · 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 2

TestUnionConversionFunction · 0.68
TESTFunction · 0.68