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

Function StressTableReader

cpp/src/arrow/csv/reader_test.cc:138–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138void StressTableReader(TableReaderFactory reader_factory) {
139#ifdef ARROW_VALGRIND
140 const int NTASKS = 10;
141 const int NROWS = 100;
142#else
143 const int NTASKS = 100;
144 const int NROWS = 1000;
145#endif
146 ASSERT_OK_AND_ASSIGN(auto table_buffer, MakeSampleCsvBuffer(NROWS));
147
148 std::vector<Future<std::shared_ptr<Table>>> task_futures(NTASKS);
149 for (int i = 0; i < NTASKS; i++) {
150 auto input = std::make_shared<io::BufferReader>(table_buffer);
151 ASSERT_OK_AND_ASSIGN(
152 auto reader, reader_factory(input, ParseOptions::Defaults(), /*block_size=*/{}));
153 task_futures[i] = reader->ReadAsync();
154 }
155 auto combined_future = All(task_futures);
156 combined_future.Wait();
157
158 ASSERT_OK_AND_ASSIGN(std::vector<Result<std::shared_ptr<Table>>> results,
159 combined_future.result());
160 for (auto&& result : results) {
161 ASSERT_OK_AND_ASSIGN(auto table, result);
162 ASSERT_EQ(NROWS, table->num_rows());
163 }
164}
165
166void StressInvalidTableReader(TableReaderFactory reader_factory) {
167#ifdef ARROW_VALGRIND

Callers 1

TESTFunction · 0.85

Calls 6

ASSERT_OK_AND_ASSIGNFunction · 0.70
AllFunction · 0.50
ReadAsyncMethod · 0.45
WaitMethod · 0.45
resultMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected