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

Method CheckNaNs

cpp/src/parquet/statistics_test.cc:1531–1552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1529 // PARQUET-1225: Float NaN values may lead to incorrect min-max
1530 template <typename Values>
1531 void CheckNaNs(ColumnDescriptor* descr, const Values& all_nans, const Values& some_nans,
1532 const Values& other_nans, c_type min, c_type max, uint8_t valid_bitmap,
1533 uint8_t valid_bitmap_no_nans) {
1534 auto some_nan_stats = MakeStatistics<ParquetType>(descr);
1535 // Ingesting only nans should not yield valid min max
1536 AssertUnsetMinMax(some_nan_stats, all_nans);
1537 // Ingesting a mix of NaNs and non-NaNs should yield a valid min max.
1538 AssertMinMaxAre(some_nan_stats, some_nans, min, max);
1539 // Ingesting only nans after a valid min/max, should have no effect
1540 AssertMinMaxAre(some_nan_stats, all_nans, min, max);
1541
1542 some_nan_stats = MakeStatistics<ParquetType>(descr);
1543 AssertUnsetMinMax(some_nan_stats, all_nans, &valid_bitmap);
1544 // NaNs should not pollute min max when excluded via null bitmap.
1545 AssertMinMaxAre(some_nan_stats, some_nans, &valid_bitmap_no_nans, min, max);
1546 // Ingesting NaNs with a null bitmap should not change the result.
1547 AssertMinMaxAre(some_nan_stats, some_nans, &valid_bitmap, min, max);
1548
1549 // An array that doesn't start with NaN
1550 auto other_stats = MakeStatistics<ParquetType>(descr);
1551 AssertMinMaxAre(other_stats, other_nans, min, max);
1552 }
1553
1554 void TestNaNs();
1555 void TestInfinities();

Callers 1

TestNaNsMethod · 0.95

Calls 2

AssertUnsetMinMaxFunction · 0.85
AssertMinMaxAreFunction · 0.85

Tested by

no test coverage detected