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

Function MakeComplex128

cpp/src/arrow/ipc/test_common.cc:1126–1141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1124}
1125
1126Status MakeComplex128(std::shared_ptr<RecordBatch>* out) {
1127 auto type = complex128();
1128 auto storage_type = checked_cast<const ExtensionType&>(*type).storage_type();
1129
1130 auto f0 = field("f0", type);
1131 auto f1 = field("f1", type, /*nullable=*/false);
1132 auto schema = ::arrow::schema({f0, f1});
1133
1134 auto a0 = ExtensionType::WrapArray(complex128(),
1135 ArrayFromJSON(storage_type, "[[1.0, -2.5], null]"));
1136 auto a1 = ExtensionType::WrapArray(
1137 complex128(), ArrayFromJSON(storage_type, "[[1.0, -2.5], [3.0, -4.0]]"));
1138
1139 *out = RecordBatch::Make(schema, a1->length(), {a0, a1});
1140 return Status::OK();
1141}
1142
1143Status MakeDictExtension(std::shared_ptr<RecordBatch>* out) {
1144 auto type = dict_extension_type();

Callers 1

TEST_FFunction · 0.50

Calls 8

complex128Function · 0.85
ArrayFromJSONFunction · 0.85
storage_typeMethod · 0.80
schemaFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
lengthMethod · 0.45

Tested by

no test coverage detected