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

Function GetColumn

cpp/src/arrow/csv/parser_test.cc:90–106  ·  view source on GitHub ↗

Read the column with the given index out of the BlockParser.

Source from the content-addressed store, hash-verified

88
89// Read the column with the given index out of the BlockParser.
90void GetColumn(const BlockParser& parser, int32_t col_index,
91 std::vector<std::string>* out, std::vector<bool>* out_quoted = nullptr) {
92 std::vector<std::string> values;
93 std::vector<bool> quoted_values;
94 auto visit = [&](const uint8_t* data, uint32_t size, bool quoted) -> Status {
95 values.push_back(std::string(reinterpret_cast<const char*>(data), size));
96 if (out_quoted) {
97 quoted_values.push_back(quoted);
98 }
99 return Status::OK();
100 };
101 ASSERT_OK(parser.VisitColumn(col_index, visit));
102 *out = std::move(values);
103 if (out_quoted) {
104 *out_quoted = std::move(quoted_values);
105 }
106}
107
108void GetLastRow(const BlockParser& parser, std::vector<std::string>* out,
109 std::vector<bool>* out_quoted = nullptr) {

Callers 4

AssertColumnEqFunction · 0.70
ReadMethod · 0.50
GetColumnMethod · 0.50
ReadColumnMethod · 0.50

Calls 2

push_backMethod · 0.80
OKFunction · 0.50

Tested by

no test coverage detected