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

Function StressTableReader

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

Source from the content-addressed store, hash-verified

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