iceberg-cpp
Loading...
Searching...
No Matches
Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
iceberg::test::MetricsTestBase Class Referenceabstract

Base test class for metrics testing, similar to Java's TestMetrics. More...

#include <metrics_test_base.h>

Inheritance diagram for iceberg::test::MetricsTestBase:
iceberg::test::ParquetMetricsTest

Protected Member Functions

virtual void SetUp ()
 
virtual Result< MetricsGetMetrics (std::shared_ptr< Schema > schema, std::shared_ptr<::arrow::Array > records)=0
 Get metrics for the given schema and records.
 
virtual Result< MetricsGetMetrics (std::shared_ptr< Schema > schema, std::shared_ptr< MetricsConfig > config, std::shared_ptr<::arrow::Array > records)=0
 Get metrics with custom MetricsConfig.
 
virtual std::string CreateOutputFile ()=0
 Create an output file for testing.
 
virtual Result< int > GetSplitCount ()=0
 Get the number of row groups/splits in a file.
 
virtual bool SupportsSmallRowGroups () const
 Whether the format supports small row groups for testing.
 
virtual bool ReportsNanCounts () const
 Whether the format reports NaN counts for floating-point fields.
 
void AssertCounts (int field_id, std::optional< int64_t > expected_value_count, std::optional< int64_t > expected_null_count, const Metrics &metrics)
 
void AssertCounts (int field_id, std::optional< int64_t > expected_value_count, std::optional< int64_t > expected_null_count, std::optional< int64_t > expected_nan_count, const Metrics &metrics)
 
void AssertColumnSizeFields (std::vector< int32_t > expected_field_ids, const Metrics &metrics)
 
template<typename T >
void AssertBounds (int field_id, std::shared_ptr< PrimitiveType > type, std::optional< T > expected_lower, std::optional< T > expected_upper, const Metrics &metrics)
 
std::shared_ptr<::arrow::Array > CreateRecordArrays (const std::shared_ptr<::arrow::Schema > &arrow_schema, const std::string &json_data)
 
void MetricsForRepeatedValues ()
 
void MetricsForTopLevelFields ()
 
void MetricsForDecimals ()
 
void MetricsForNestedStructFields ()
 
void MetricsModeForNestedStructFields ()
 
void MetricsForListAndMapElements ()
 
void MetricsForNullColumns ()
 
void MetricsForNaNColumns ()
 
void ColumnBoundsWithNaNValueAtFront ()
 
void ColumnBoundsWithNaNValueInMiddle ()
 
void ColumnBoundsWithNaNValueAtEnd ()
 
void MetricsForTopLevelWithMultipleRowGroup ()
 
void MetricsForNestedStructFieldsWithMultipleRowGroup ()
 
void NoneMetricsMode ()
 
void CountsMetricsMode ()
 
void FullMetricsMode ()
 
void TruncateStringMetricsMode ()
 
void TruncateBinaryMetricsMode ()
 

Static Protected Member Functions

static std::shared_ptr< SchemaSimpleSchema ()
 
static std::shared_ptr< SchemaNestedSchema ()
 
static std::shared_ptr< SchemaFloatDoubleSchema ()
 

Protected Attributes

std::shared_ptr< FileIOfile_io_
 
std::string temp_dir_
 
std::string path_
 

Detailed Description

Base test class for metrics testing, similar to Java's TestMetrics.

This class provides common test infrastructure and helper methods for testing metrics collection across different file formats (Parquet, Avro, ORC).

Member Function Documentation

◆ CreateOutputFile()

virtual std::string iceberg::test::MetricsTestBase::CreateOutputFile ( )
protectedpure virtual

Create an output file for testing.

Implemented in iceberg::test::ParquetMetricsTest.

◆ GetMetrics() [1/2]

virtual Result< Metrics > iceberg::test::MetricsTestBase::GetMetrics ( std::shared_ptr< Schema schema,
std::shared_ptr< MetricsConfig config,
std::shared_ptr<::arrow::Array >  records 
)
protectedpure virtual

Get metrics with custom MetricsConfig.

Implemented in iceberg::test::ParquetMetricsTest.

◆ GetMetrics() [2/2]

virtual Result< Metrics > iceberg::test::MetricsTestBase::GetMetrics ( std::shared_ptr< Schema schema,
std::shared_ptr<::arrow::Array >  records 
)
protectedpure virtual

Get metrics for the given schema and records.

Implemented in iceberg::test::ParquetMetricsTest.

◆ GetSplitCount()

virtual Result< int > iceberg::test::MetricsTestBase::GetSplitCount ( )
protectedpure virtual

Get the number of row groups/splits in a file.

Implemented in iceberg::test::ParquetMetricsTest.

◆ ReportsNanCounts()

virtual bool iceberg::test::MetricsTestBase::ReportsNanCounts ( ) const
inlineprotectedvirtual

Whether the format reports NaN counts for floating-point fields.

Reimplemented in iceberg::test::ParquetMetricsTest.

◆ SupportsSmallRowGroups()

virtual bool iceberg::test::MetricsTestBase::SupportsSmallRowGroups ( ) const
inlineprotectedvirtual

Whether the format supports small row groups for testing.

Reimplemented in iceberg::test::ParquetMetricsTest.


The documentation for this class was generated from the following files: