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

Method CheckNaNs

cpp/src/parquet/statistics_test.cc:1464–1485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1462 // PARQUET-1225: Float NaN values may lead to incorrect min-max
1463 template <typename Values>
1464 void CheckNaNs(ColumnDescriptor* descr, const Values& all_nans, const Values& some_nans,
1465 const Values& other_nans, c_type min, c_type max, uint8_t valid_bitmap,
1466 uint8_t valid_bitmap_no_nans) {
1467 auto some_nan_stats = MakeStatistics<ParquetType>(descr);
1468 // Ingesting only nans should not yield valid min max
1469 AssertUnsetMinMax(some_nan_stats, all_nans);
1470 // Ingesting a mix of NaNs and non-NaNs should yield a valid min max.
1471 AssertMinMaxAre(some_nan_stats, some_nans, min, max);
1472 // Ingesting only nans after a valid min/max, should have no effect
1473 AssertMinMaxAre(some_nan_stats, all_nans, min, max);
1474
1475 some_nan_stats = MakeStatistics<ParquetType>(descr);
1476 AssertUnsetMinMax(some_nan_stats, all_nans, &valid_bitmap);
1477 // NaNs should not pollute min max when excluded via null bitmap.
1478 AssertMinMaxAre(some_nan_stats, some_nans, &valid_bitmap_no_nans, min, max);
1479 // Ingesting NaNs with a null bitmap should not change the result.
1480 AssertMinMaxAre(some_nan_stats, some_nans, &valid_bitmap, min, max);
1481
1482 // An array that doesn't start with NaN
1483 auto other_stats = MakeStatistics<ParquetType>(descr);
1484 AssertMinMaxAre(other_stats, other_nans, min, max);
1485 }
1486
1487 void TestNaNs();
1488 void TestInfinities();

Callers 1

TestNaNsMethod · 0.95

Calls 2

AssertUnsetMinMaxFunction · 0.85
AssertMinMaxAreFunction · 0.85

Tested by

no test coverage detected