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

Function GetColumnNames

cpp/src/arrow/dataset/file_csv.cc:213–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213Result<std::unordered_set<std::string>> GetColumnNames(
214 const csv::ReadOptions& read_options, const csv::ParseOptions& parse_options,
215 std::string_view first_block, MemoryPool* pool) {
216 ARROW_ASSIGN_OR_RAISE(
217 std::vector<std::string> ordered_names,
218 GetOrderedColumnNames(read_options, parse_options, first_block, pool));
219 std::unordered_set<std::string> unordered_names;
220 for (const auto& column : ordered_names) {
221 if (!unordered_names.emplace(column).second) {
222 return Status::Invalid("CSV file contained multiple columns named ", column);
223 }
224 }
225 return unordered_names;
226}
227
228static inline Result<csv::ConvertOptions> GetConvertOptions(
229 const CsvFileFormat& format, const ScanOptions* scan_options,

Callers

nothing calls this directly

Calls 3

GetOrderedColumnNamesFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.50
InvalidFunction · 0.50

Tested by

no test coverage detected