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

Function TEST_F

cpp/src/parquet/reader_test.cc:268–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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