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

Function MakeArrayFromScalar

cpp/src/arrow/array/util.cc:905–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

903}
904
905Result<std::shared_ptr<Array>> MakeArrayFromScalar(const Scalar& scalar, int64_t length,
906 MemoryPool* pool) {
907 // Null union scalars still have a type code associated
908 if (!scalar.is_valid && !is_union(scalar.type->id())) {
909 return MakeArrayOfNull(scalar.type, length, pool);
910 }
911 return RepeatedArrayFactory(pool, scalar, length).Create();
912}
913
914Result<std::shared_ptr<Array>> MakeEmptyArray(std::shared_ptr<DataType> type,
915 MemoryPool* memory_pool) {

Callers 15

VisitMethod · 0.70
VisitMethod · 0.70
ToStringMethod · 0.50
RunGroupByFunction · 0.50
FilterSingleBatchMethod · 0.50
KeyPayloadFromInputMethod · 0.50
GenerateMethod · 0.50
TESTFunction · 0.50
ToRecordBatchMethod · 0.50
MakeStructExecFunction · 0.50

Calls 5

MakeArrayOfNullFunction · 0.85
is_unionFunction · 0.50
idMethod · 0.45
CreateMethod · 0.45

Tested by 10

RunGroupByFunction · 0.40
TESTFunction · 0.40
ASSERT_OK_AND_ASSIGNFunction · 0.40
MakeStructFunction · 0.40
TESTFunction · 0.40
TYPED_TESTFunction · 0.40
TESTFunction · 0.40
ValidateConsumeMethod · 0.40