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

Function join

cpp/src/arrow/json/chunker_test.cc:46–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45template <typename Lines>
46static std::shared_ptr<Buffer> join(Lines&& lines, std::string delimiter,
47 bool delimiter_at_end = true) {
48 std::shared_ptr<Buffer> joined;
49 BufferVector line_buffers;
50 auto delimiter_buffer = std::make_shared<Buffer>(delimiter);
51 for (const auto& line : lines) {
52 line_buffers.push_back(std::make_shared<Buffer>(line));
53 line_buffers.push_back(delimiter_buffer);
54 }
55 if (!delimiter_at_end) {
56 line_buffers.pop_back();
57 }
58 return *ConcatenateBuffers(line_buffers);
59}
60
61static bool WhitespaceOnly(string_view s) {
62 return s.find_first_not_of(" \t\r\n") == string_view::npos;

Callers 4

TESTFunction · 0.85
BuildLocationMethod · 0.85
TEST_PFunction · 0.85
TESTFunction · 0.85

Calls 2

ConcatenateBuffersFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected