iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
iceberg::CountAggregate Class Referenceabstract

Base class for COUNT aggregates. More...

#include <aggregate.h>

Inheritance diagram for iceberg::CountAggregate:
iceberg::BoundAggregate iceberg::Aggregate< BoundTerm > iceberg::Bound iceberg::Expression iceberg::util::Formattable iceberg::CountNonNullAggregate iceberg::CountNullAggregate iceberg::CountStarAggregate

Public Member Functions

Result< LiteralEvaluate (const StructLike &data) const override
 Evaluate this expression against a row-based data.
 
Result< LiteralEvaluate (const DataFile &file) const override
 
std::unique_ptr< AggregatorNewAggregator () const override
 Create a new aggregator for this aggregate.
 
virtual Result< int64_t > CountFor (const StructLike &data) const =0
 Count for a single row. Subclasses implement this.
 
virtual Result< int64_t > CountFor (const DataFile &file) const =0
 Count using metrics from a data file.
 
- Public Member Functions inherited from iceberg::BoundAggregate
std::shared_ptr< BoundReferencereference () override
 Returns the underlying bound reference for this term.
 
virtual bool HasValue (const DataFile &file) const =0
 Whether metrics in the data file are sufficient to evaluate.
 
bool is_bound_aggregate () const override
 
- Public Member Functions inherited from iceberg::Aggregate< BoundTerm >
Expression::Operation op () const override
 Returns the operation for an expression node.
 
const std::shared_ptr< T > & term () const
 
std::string ToString () const override
 Get a user-readable string representation.
 
- Public Member Functions inherited from iceberg::Expression
virtual Result< std::shared_ptr< Expression > > Negate () const
 Returns the negation of this expression, equivalent to not(this).
 
virtual bool Equals (const Expression &other) const
 Returns whether this expression will accept the same values as another.
 
std::string ToString () const override
 Get a user-readable string representation.
 
virtual bool is_unbound_predicate () const
 
virtual bool is_bound_predicate () const
 
virtual bool is_unbound_aggregate () const
 

Protected Member Functions

 CountAggregate (Expression::Operation op, std::shared_ptr< BoundTerm > term)
 
- Protected Member Functions inherited from iceberg::BoundAggregate
 BoundAggregate (Expression::Operation op, std::shared_ptr< BoundTerm > term)
 
- Protected Member Functions inherited from iceberg::Aggregate< BoundTerm >
 Aggregate (Expression::Operation op, std::shared_ptr< T > term)
 

Additional Inherited Members

- Public Types inherited from iceberg::Expression
enum class  Operation {
  kTrue , kFalse , kIsNull , kNotNull ,
  kIsNan , kNotNan , kLt , kLtEq ,
  kGt , kGtEq , kEq , kNotEq ,
  kIn , kNotIn , kNot , kAnd ,
  kOr , kStartsWith , kNotStartsWith , kCount ,
  kCountNull , kCountStar , kMax , kMin
}
 Operation types for expressions.
 
- Static Protected Member Functions inherited from iceberg::Aggregate< BoundTerm >
static constexpr bool IsSupportedOp (Expression::Operation op)
 
- Protected Attributes inherited from iceberg::Aggregate< BoundTerm >
Expression::Operation operation_
 
std::shared_ptr< T > term_
 

Detailed Description

Base class for COUNT aggregates.

Member Function Documentation

◆ CountFor() [1/2]

virtual Result< int64_t > iceberg::CountAggregate::CountFor ( const DataFile file) const
pure virtual

Count using metrics from a data file.

Implemented in iceberg::CountNonNullAggregate, iceberg::CountNullAggregate, and iceberg::CountStarAggregate.

◆ CountFor() [2/2]

virtual Result< int64_t > iceberg::CountAggregate::CountFor ( const StructLike data) const
pure virtual

Count for a single row. Subclasses implement this.

Implemented in iceberg::CountNonNullAggregate, iceberg::CountNullAggregate, and iceberg::CountStarAggregate.

◆ Evaluate() [1/2]

Result< Literal > iceberg::CountAggregate::Evaluate ( const DataFile file) const
overridevirtual

◆ Evaluate() [2/2]

Result< Literal > iceberg::CountAggregate::Evaluate ( const StructLike data) const
overridevirtual

Evaluate this expression against a row-based data.

Implements iceberg::BoundAggregate.

◆ NewAggregator()

std::unique_ptr< BoundAggregate::Aggregator > iceberg::CountAggregate::NewAggregator ( ) const
overridevirtual

Create a new aggregator for this aggregate.

Note
The returned aggregator cannot outlive the BoundAggregate that creates it.

Implements iceberg::BoundAggregate.


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