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

Method VerifyRows

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

Source from the content-addressed store, hash-verified

100}
101
102Status TupleTextFileUtil::VerifyRows(
103 const string& cmp_file_path, const string& ref_file_path) {
104 ReferenceRowsMap cache;
105 int64_t ref_row_count = 0;
106 int64_t cmp_row_count = 0;
107 {
108 TupleTextFileReader ref_reader(ref_file_path);
109 RETURN_IF_ERROR(ref_reader.Open());
110 RETURN_IF_ERROR(InsertRowsFromReferenceFile(cache, &ref_reader, &ref_row_count));
111 }
112 // Verify all the rows.
113 {
114 TupleTextFileReader cmp_reader(cmp_file_path);
115 RETURN_IF_ERROR(cmp_reader.Open());
116 RETURN_IF_ERROR(
117 VerifyRowsFromComparisonFile(ref_file_path, cache, &cmp_reader, &cmp_row_count));
118 }
119
120 // Verify all the row counts.
121 if (ref_row_count != cmp_row_count) {
122 return Status(TErrorCode::TUPLE_CACHE_INCONSISTENCY,
123 Substitute(
124 "Row count different. Reference file '$0': '$1', comparison file '$2': '$3'",
125 ref_file_path + DEBUG_TUPLE_CACHE_BAD_POSTFIX, ref_row_count,
126 cmp_file_path + DEBUG_TUPLE_CACHE_BAD_POSTFIX, cmp_row_count));
127 }
128 return VerifyRowCount(cache);
129}
130
131static Status ValidateAndOpenFile(const string& path, TupleTextFileReader& reader) {
132 if (!reader.Open().ok()) {

Callers

nothing calls this directly

Calls 6

SubstituteFunction · 0.85
VerifyRowCountFunction · 0.85
StatusClass · 0.70
OpenMethod · 0.45

Tested by

no test coverage detected