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

Function GenerateString

cpp/src/arrow/record_batch_test.cc:1483–1495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1481}
1482
1483std::shared_ptr<Array> GenerateString(const std::shared_ptr<DataType>& data_type) {
1484 if (data_type->id() == Type::FIXED_SIZE_BINARY) {
1485 auto byte_width = data_type->byte_width();
1486 std::string a(byte_width, 'a');
1487 std::string b(byte_width, 'b');
1488 std::string c(byte_width, 'c');
1489 std::stringstream ss;
1490 ss << R"([")" << a << R"(",")" << b << R"(",")" << c << R"("])";
1491 return ArrayFromJSON(data_type, ss.str());
1492 } else {
1493 return ArrayFromJSON(data_type, R"(["a","b","c"])");
1494 }
1495}
1496
1497}; // namespace
1498

Callers 1

Calls 4

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

Tested by

no test coverage detected