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

Method Make

cpp/src/arrow/compute/exec.cc:215–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215Result<ExecBatch> ExecBatch::Make(std::vector<Datum> values, int64_t length) {
216 // Infer the length again and/or validate the given length.
217 const int64_t inferred_length = DoInferLength(values);
218 switch (inferred_length) {
219 case kEmptyInput:
220 if (length < 0) {
221 return Status::Invalid(
222 "Cannot infer ExecBatch length without at least one value");
223 }
224 break;
225
226 case kInvalidValues:
227 return Status::Invalid(
228 "Arrays used to construct an ExecBatch must have equal length");
229
230 default:
231 if (length < 0) {
232 length = inferred_length;
233 } else if (length != inferred_length) {
234 return Status::Invalid("Length used to construct an ExecBatch is invalid");
235 }
236 break;
237 }
238
239 return ExecBatch(std::move(values), length);
240}
241
242Result<std::shared_ptr<RecordBatch>> ExecBatch::ToRecordBatch(
243 std::shared_ptr<Schema> schema, MemoryPool* pool) const {

Callers

nothing calls this directly

Calls 3

DoInferLengthFunction · 0.85
ExecBatchFunction · 0.70
InvalidFunction · 0.50

Tested by

no test coverage detected