iceberg-cpp
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
iceberg::BoundSetPredicate Class Reference

Bound set predicate (membership testing against a set of values). More...

#include <predicate.h>

Inheritance diagram for iceberg::BoundSetPredicate:
iceberg::BoundPredicate iceberg::Predicate< BoundTerm > iceberg::Bound iceberg::Expression iceberg::util::Formattable

Public Types

using LiteralSet = std::unordered_set< Literal, LiteralHash >
 
- Public Types inherited from iceberg::BoundPredicate
enum class  Kind : int8_t { kUnary = 0 , kLiteral , kSet }
 
- 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.
 

Public Member Functions

const LiteralSet & literal_set () const
 Returns the set of literals to test against.
 
Result< bool > Test (const Literal &value) const override
 Test a value against this predicate.
 
Kind kind () const override
 Returns the kind of this bound predicate.
 
std::string ToString () const override
 Get a user-readable string representation.
 
Result< std::shared_ptr< Expression > > Negate () const override
 Returns the negation of this expression, equivalent to not(this).
 
bool Equals (const Expression &other) const override
 Returns whether this expression will accept the same values as another.
 
- Public Member Functions inherited from iceberg::BoundPredicate
std::shared_ptr< BoundReferencereference () override
 Returns the underlying bound reference for this term.
 
Result< LiteralEvaluate (const StructLike &data) const override
 Evaluate this expression against a row-based data.
 
bool is_bound_predicate () const override
 
- Public Member Functions inherited from iceberg::Predicate< BoundTerm >
Expression::Operation op () const override
 Returns the operation for an expression node.
 
const std::shared_ptr< T > & term () const
 Returns the term this predicate tests.
 
- Public Member Functions inherited from iceberg::Expression
std::string ToString () const override
 Get a user-readable string representation.
 
virtual bool is_unbound_predicate () const
 
virtual bool is_unbound_aggregate () const
 
virtual bool is_bound_aggregate () const
 

Static Public Member Functions

static Result< std::unique_ptr< BoundSetPredicate > > Make (Expression::Operation op, std::shared_ptr< BoundTerm > term, std::span< const Literal > literals)
 Create a bound set predicate.
 
static Result< std::unique_ptr< BoundSetPredicate > > Make (Expression::Operation op, std::shared_ptr< BoundTerm > term, LiteralSet value_set)
 Create a bound set predicate using a set of literals.
 

Additional Inherited Members

- Protected Member Functions inherited from iceberg::BoundPredicate
 BoundPredicate (Expression::Operation op, std::shared_ptr< BoundTerm > term)
 
- Protected Member Functions inherited from iceberg::Predicate< BoundTerm >
 Predicate (Expression::Operation op, std::shared_ptr< T > term)
 Create a predicate with an operation and term.
 
- Protected Attributes inherited from iceberg::Predicate< BoundTerm >
Expression::Operation operation_
 
std::shared_ptr< T > term_
 

Detailed Description

Bound set predicate (membership testing against a set of values).

Member Function Documentation

◆ Equals()

bool iceberg::BoundSetPredicate::Equals ( const Expression other) const
overridevirtual

Returns whether this expression will accept the same values as another.

Parameters
otheranother expression
Returns
true if the expressions are equivalent

Reimplemented from iceberg::Expression.

◆ kind()

Kind iceberg::BoundSetPredicate::kind ( ) const
inlineoverridevirtual

Returns the kind of this bound predicate.

Implements iceberg::BoundPredicate.

◆ Make() [1/2]

Result< std::unique_ptr< BoundSetPredicate > > iceberg::BoundSetPredicate::Make ( Expression::Operation  op,
std::shared_ptr< BoundTerm term,
LiteralSet  value_set 
)
static

Create a bound set predicate using a set of literals.

Parameters
opThe set operation (kIn, kNotIn)
termThe bound term to test for membership
value_setThe set of literal values to test against
Returns
Result containing the bound set predicate or an error

◆ Make() [2/2]

Result< std::unique_ptr< BoundSetPredicate > > iceberg::BoundSetPredicate::Make ( Expression::Operation  op,
std::shared_ptr< BoundTerm term,
std::span< const Literal literals 
)
static

Create a bound set predicate.

Parameters
opThe set operation (kIn, kNotIn)
termThe bound term to test for membership
literalsThe set of literal values to test against
Returns
Result containing the bound set predicate or an error

◆ Negate()

Result< std::shared_ptr< Expression > > iceberg::BoundSetPredicate::Negate ( ) const
overridevirtual

Returns the negation of this expression, equivalent to not(this).

Reimplemented from iceberg::Expression.

◆ Test()

Result< bool > iceberg::BoundSetPredicate::Test ( const Literal value) const
overridevirtual

Test a value against this predicate.

Parameters
valueThe literal value to test
Returns
true if the predicate passes, false otherwise

Implements iceberg::BoundPredicate.

◆ ToString()

std::string iceberg::BoundSetPredicate::ToString ( ) const
overridevirtual

Get a user-readable string representation.

Implements iceberg::util::Formattable.


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