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

Function MakeFWBinary

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

Source from the content-addressed store, hash-verified

1047}
1048
1049Status MakeFWBinary(std::shared_ptr<RecordBatch>* out) {
1050 std::vector<bool> is_valid = {true, true, true, false};
1051 auto f0 = field("f0", fixed_size_binary(4));
1052 auto f1 = field("f1", fixed_size_binary(0));
1053 auto schema = ::arrow::schema({f0, f1});
1054
1055 std::shared_ptr<Array> a1, a2;
1056
1057 FixedSizeBinaryBuilder b1(f0->type());
1058 FixedSizeBinaryBuilder b2(f1->type());
1059
1060 std::vector<std::string> values1 = {"foo1", "foo2", "foo3", "foo4"};
1061 AppendValues(is_valid, values1, &b1);
1062
1063 std::vector<std::string> values2 = {"", "", "", ""};
1064 AppendValues(is_valid, values2, &b2);
1065
1066 RETURN_NOT_OK(b1.Finish(&a1));
1067 RETURN_NOT_OK(b2.Finish(&a2));
1068
1069 *out = RecordBatch::Make(schema, a1->length(), {a1, a2});
1070 return Status::OK();
1071}
1072
1073Status MakeDecimal(std::shared_ptr<RecordBatch>* out) {
1074 constexpr int kLength = 10;

Callers 1

BatchesFunction · 0.85

Calls 9

fixed_size_binaryFunction · 0.85
schemaFunction · 0.70
AppendValuesFunction · 0.70
fieldFunction · 0.50
MakeFunction · 0.50
OKFunction · 0.50
typeMethod · 0.45
FinishMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected