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

Function GenerateString

cpp/src/arrow/record_batch_test.cc:1439–1451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1437}
1438
1439std::shared_ptr<Array> GenerateString(const std::shared_ptr<DataType>& data_type) {
1440 if (data_type->id() == Type::FIXED_SIZE_BINARY) {
1441 auto byte_width = data_type->byte_width();
1442 std::string a(byte_width, 'a');
1443 std::string b(byte_width, 'b');
1444 std::string c(byte_width, 'c');
1445 std::stringstream ss;
1446 ss << R"([")" << a << R"(",")" << b << R"(",")" << c << R"("])";
1447 return ArrayFromJSON(data_type, ss.str());
1448 } else {
1449 return ArrayFromJSON(data_type, R"(["a","b","c"])");
1450 }
1451}
1452
1453}; // namespace
1454

Callers 1

Calls 4

ArrayFromJSONFunction · 0.85
strMethod · 0.80
idMethod · 0.45
byte_widthMethod · 0.45

Tested by

no test coverage detected