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

Function ScalarVectorToArray

cpp/src/arrow/testing/generator.cc:200–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200Result<std::shared_ptr<Array>> ScalarVectorToArray(const ScalarVector& scalars) {
201 if (scalars.empty()) {
202 return Status::NotImplemented("ScalarVectorToArray with no scalars");
203 }
204 std::unique_ptr<arrow::ArrayBuilder> builder;
205 RETURN_NOT_OK(MakeBuilder(default_memory_pool(), scalars[0]->type, &builder));
206 RETURN_NOT_OK(builder->AppendScalars(scalars));
207 std::shared_ptr<Array> out;
208 RETURN_NOT_OK(builder->Finish(&out));
209 return out;
210}
211
212namespace gen {
213

Callers 1

ASSERT_OK_AND_ASSIGNFunction · 0.85

Calls 6

default_memory_poolFunction · 0.85
NotImplementedFunction · 0.50
MakeBuilderFunction · 0.50
emptyMethod · 0.45
AppendScalarsMethod · 0.45
FinishMethod · 0.45

Tested by 1

ASSERT_OK_AND_ASSIGNFunction · 0.68