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

Function MakeDecimal

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

Source from the content-addressed store, hash-verified

1071}
1072
1073Status MakeDecimal(std::shared_ptr<RecordBatch>* out) {
1074 constexpr int kLength = 10;
1075 auto type = decimal128(38, 4);
1076 auto f0 = field("f0", type);
1077 auto f1 = field("f1", type);
1078 auto schema = ::arrow::schema({f0, f1});
1079
1080 auto gen = random::RandomArrayGenerator(/*seed=*/1);
1081 auto a1 = gen.Decimal128(type, kLength, /*null_probability=*/0.1);
1082 auto a2 = std::make_shared<Decimal128Array>(type, kLength, a1->data()->buffers[1]);
1083
1084 *out = RecordBatch::Make(schema, kLength, {a1, a2});
1085 return Status::OK();
1086}
1087
1088Status MakeNull(std::shared_ptr<RecordBatch>* out) {
1089 auto f0 = field("f0", null());

Callers

nothing calls this directly

Calls 7

schemaFunction · 0.70
decimal128Function · 0.50
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
Decimal128Method · 0.45
dataMethod · 0.45

Tested by

no test coverage detected