MCPcopy Create free account
hub / github.com/apache/impala / ForEachRow

Function ForEachRow

be/src/exec/tuple-text-file-util.cc:43–58  ·  view source on GitHub ↗

Applies fn to each row read from reader. Returns the number of rows read.

Source from the content-addressed store, hash-verified

41typedef std::function<Status(const string&)> TupleCacheRowFunction;
42// Applies fn to each row read from reader. Returns the number of rows read.
43static Status ForEachRow(
44 TupleTextFileReader* reader, TupleCacheRowFunction& fn, int64_t* row_count) {
45 DCHECK(reader != nullptr);
46 DCHECK(row_count != nullptr);
47 bool eos = false;
48 int64_t num_rows = 0;
49 Status read_status;
50 string row_str;
51 do {
52 RETURN_IF_ERROR(reader->GetNext(&row_str, &eos));
53 RETURN_IF_ERROR(fn(row_str));
54 num_rows++;
55 } while (!eos);
56 *row_count = num_rows;
57 return Status::OK();
58}
59
60static Status VerifyRowsFromComparisonFile(const string& ref_file_path,
61 ReferenceRowsMap& cache, TupleTextFileReader* reader, int64_t* row_count) {

Callers 2

Calls 3

OKFunction · 0.85
fnFunction · 0.50
GetNextMethod · 0.45

Tested by

no test coverage detected