| 131 | } |
| 132 | |
| 133 | BenchmarkQuery InterpretedBenchmark::ReadQueryFromReader(BenchmarkFileReader &reader, const string &sql, |
| 134 | const string &header) { |
| 135 | BenchmarkQuery query; |
| 136 | query.query = sql; |
| 137 | query.column_count = header.size(); |
| 138 | // keep reading results until eof |
| 139 | string line; |
| 140 | while (reader.ReadLine(line)) { |
| 141 | if (line.empty()) { |
| 142 | break; |
| 143 | } |
| 144 | auto result_splits = StringUtil::Split(line, "\t"); |
| 145 | if (result_splits.size() != query.column_count) { |
| 146 | throw std::runtime_error(reader.FormatException("expected " + std::to_string(result_splits.size()) + |
| 147 | " values but got " + std::to_string(query.column_count))); |
| 148 | } |
| 149 | query.expected_result.push_back(std::move(result_splits)); |
| 150 | } |
| 151 | return query; |
| 152 | } |
| 153 | |
| 154 | static void ThrowResultModeError(BenchmarkFileReader &reader) { |
| 155 | vector<string> valid_options = {"streaming", "arrow", "materialized"}; |
nothing calls this directly
no test coverage detected