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

Function AssertStatsSet

cpp/src/parquet/statistics_test.cc:832–847  ·  view source on GitHub ↗

Helper for basic statistics tests below

Source from the content-addressed store, hash-verified

830
831// Helper for basic statistics tests below
832void AssertStatsSet(const ApplicationVersion& version,
833 std::shared_ptr<parquet::WriterProperties> props,
834 const ColumnDescriptor* column, bool expected_is_set) {
835 auto metadata_builder = ColumnChunkMetaDataBuilder::Make(props, column);
836 auto column_chunk = ColumnChunkMetaData::Make(metadata_builder->contents(), column,
837 default_reader_properties(), &version);
838 EncodedStatistics stats;
839 stats.set_is_signed(false);
840 metadata_builder->SetStatistics(stats);
841 ASSERT_EQ(column_chunk->is_stats_set(), expected_is_set);
842 if (expected_is_set) {
843 ASSERT_TRUE(column_chunk->encoded_statistics() != nullptr);
844 } else {
845 ASSERT_TRUE(column_chunk->encoded_statistics() == nullptr);
846 }
847}
848
849// Statistics are restricted for few types in older parquet version
850TEST(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