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

Function TEST_F

cpp/src/parquet/reader_test.cc:265–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263};
264
265TEST_F(TestBooleanRLE, TestBooleanScanner) {
266#ifndef ARROW_WITH_ZLIB
267 GTEST_SKIP() << "Test requires Zlib compression";
268#endif
269 int nvalues = 68;
270 int validation_values = 16;
271
272 auto group = reader_->RowGroup(0);
273
274 // column 0, id
275 auto scanner = std::make_shared<BoolScanner>(group->Column(0));
276
277 bool val = false;
278 bool is_null = false;
279
280 // For this file, 3rd and 16th index value is null
281 std::vector<bool> expected_null = {false, false, true, false, false, false,
282 false, false, false, false, false, false,
283 false, false, false, true};
284 std::vector<bool> expected_value = {true, false, false, true, true, false,
285 false, true, true, true, false, false,
286 true, true, false, false};
287
288 // Assert sizes are same
289 ASSERT_EQ(validation_values, expected_null.size());
290 ASSERT_EQ(validation_values, expected_value.size());
291
292 for (int i = 0; i < validation_values; i++) {
293 ASSERT_TRUE(scanner->HasNext());
294 ASSERT_TRUE(scanner->NextValue(&val, &is_null));
295
296 ASSERT_EQ(expected_null[i], is_null);
297
298 // Only validate val if not null
299 if (!is_null) {
300 ASSERT_EQ(expected_value[i], val);
301 }
302 }
303
304 // Loop through rest of the values to assert data exists
305 for (int i = validation_values; i < nvalues; i++) {
306 ASSERT_TRUE(scanner->HasNext());
307 ASSERT_TRUE(scanner->NextValue(&val, &is_null));
308 }
309
310 // Attempt to read past end of column
311 ASSERT_FALSE(scanner->HasNext());
312 ASSERT_FALSE(scanner->NextValue(&val, &is_null));
313}
314
315TEST_F(TestBooleanRLE, TestBatchRead) {
316#ifndef ARROW_WITH_ZLIB

Callers

nothing calls this directly

Calls 15

to_stringFunction · 0.85
CheckRowGroupMetadataFunction · 0.85
ReadMetaDataFunction · 0.85
OpenFileFunction · 0.85
alltypes_plainFunction · 0.85
rle_dict_snappy_checksumFunction · 0.85

Tested by

no test coverage detected