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

Function MakeArrayFromScalar

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

Source from the content-addressed store, hash-verified

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