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

Function TryReadDataFile

cpp/src/parquet/arrow/arrow_reader_writer_test.cc:4280–4303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4278}
4279
4280void TryReadDataFile(const std::string& path,
4281 ::arrow::StatusCode expected_code = ::arrow::StatusCode::OK,
4282 const std::string& expected_message = "") {
4283 auto pool = ::arrow::default_memory_pool();
4284
4285 Status s;
4286 auto reader_result = FileReader::Make(pool, ParquetFileReader::OpenFile(path, false));
4287 if (reader_result.ok()) {
4288 auto table_result = (*reader_result)->ReadTable();
4289 s = table_result.status();
4290 } else {
4291 s = reader_result.status();
4292 }
4293
4294 ASSERT_EQ(s.code(), expected_code)
4295 << "Expected reading file to return " << arrow::Status::CodeAsString(expected_code)
4296 << ", but got " << s.ToString();
4297
4298 if (!expected_message.empty()) {
4299 ASSERT_EQ(s.message().find(expected_message), 0)
4300 << "Expected an error message beginning with '" << expected_message
4301 << "', but got '" << s.message() << "'";
4302 }
4303}
4304
4305TEST(TestArrowReaderAdHoc, Int96BadMemoryAccess) {
4306 // PARQUET-995

Callers 1

TESTFunction · 0.85

Calls 10

default_memory_poolFunction · 0.85
OpenFileFunction · 0.85
MakeFunction · 0.50
okMethod · 0.45
ReadTableMethod · 0.45
statusMethod · 0.45
codeMethod · 0.45
ToStringMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected