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

Function AssertStatsSet

cpp/src/parquet/statistics_test.cc:899–914  ·  view source on GitHub ↗

Helper for basic statistics tests below

Source from the content-addressed store, hash-verified

897
898// Helper for basic statistics tests below
899void AssertStatsSet(const ApplicationVersion& version,
900 std::shared_ptr<parquet::WriterProperties> props,
901 const ColumnDescriptor* column, bool expected_is_set) {
902 auto metadata_builder = ColumnChunkMetaDataBuilder::Make(props, column);
903 auto column_chunk = ColumnChunkMetaData::Make(metadata_builder->contents(), column,
904 default_reader_properties(), &version);
905 EncodedStatistics stats;
906 stats.set_is_signed(false);
907 metadata_builder->SetStatistics(stats);
908 ASSERT_EQ(column_chunk->is_stats_set(), expected_is_set);
909 if (expected_is_set) {
910 ASSERT_TRUE(column_chunk->encoded_statistics() != nullptr);
911 } else {
912 ASSERT_TRUE(column_chunk->encoded_statistics() == nullptr);
913 }
914}
915
916// Statistics are restricted for few types in older parquet version
917TEST(CorruptStatistics, Basics) {

Callers 1

TESTFunction · 0.85

Calls 6

MakeFunction · 0.70
contentsMethod · 0.45
SetStatisticsMethod · 0.45
is_stats_setMethod · 0.45
encoded_statisticsMethod · 0.45

Tested by

no test coverage detected