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

Function WriteStructBatch

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

Source from the content-addressed store, hash-verified

701}
702
703Status WriteStructBatch(const Array& array, int64_t orc_offset,
704 liborc::ColumnVectorBatch* column_vector_batch) {
705 std::shared_ptr<Array> array_ = MakeArray(array.data());
706 std::shared_ptr<StructArray> struct_array(checked_pointer_cast<StructArray>(array_));
707 auto batch = checked_cast<liborc::StructVectorBatch*>(column_vector_batch);
708 std::size_t size = array.type()->fields().size();
709 int64_t arrow_length = array.length();
710 int64_t running_arrow_offset = 0, running_orc_offset = orc_offset;
711 // First fill fields of ColumnVectorBatch
712 if (array.null_count()) {
713 batch->hasNulls = true;
714 }
715 for (; running_arrow_offset < arrow_length;
716 running_orc_offset++, running_arrow_offset++) {
717 if (array.IsNull(running_arrow_offset)) {
718 batch->notNull[running_orc_offset] = false;
719 } else {
720 batch->notNull[running_orc_offset] = true;
721 }
722 }
723 // Fill the fields
724 for (std::size_t i = 0; i < size; i++) {
725 batch->fields[i]->resize(orc_offset + arrow_length);
726 RETURN_NOT_OK(WriteBatch(*(struct_array->field(static_cast<int>(i))), orc_offset,
727 batch->fields[i]));
728 }
729 return Status::OK();
730}
731
732template <class ArrayType>
733Status WriteListBatch(const Array& array, int64_t orc_offset,

Callers 1

WriteBatchFunction · 0.85

Calls 12

resizeMethod · 0.80
WriteBatchFunction · 0.70
MakeArrayFunction · 0.50
OKFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
fieldsMethod · 0.45
typeMethod · 0.45
lengthMethod · 0.45
null_countMethod · 0.45
IsNullMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected