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

Rewrites an expression tree as an unbound expression whose literal values are replaced with type-aware placeholders (e.g. "(2-digit-int)", "(hash-3f9a1c02)", "(date-5-days-ago)"). More...

#include <sanitize_expression.h>

Inheritance diagram for iceberg::SanitizeExpression:
iceberg::ExpressionVisitor< std::shared_ptr< Expression > >

Public Member Functions

Result< std::shared_ptr< Expression > > AlwaysTrue () override
 Visit a True expression (always evaluates to true).
 
Result< std::shared_ptr< Expression > > AlwaysFalse () override
 Visit a False expression (always evaluates to false).
 
Result< std::shared_ptr< Expression > > Not (const std::shared_ptr< Expression > &child_result) override
 
Result< std::shared_ptr< Expression > > And (const std::shared_ptr< Expression > &left_result, const std::shared_ptr< Expression > &right_result) override
 
Result< std::shared_ptr< Expression > > Or (const std::shared_ptr< Expression > &left_result, const std::shared_ptr< Expression > &right_result) override
 
Result< std::shared_ptr< Expression > > Predicate (const std::shared_ptr< BoundPredicate > &pred) override
 Visit a bound predicate.
 
Result< std::shared_ptr< Expression > > Predicate (const std::shared_ptr< UnboundPredicate > &pred) override
 Visit an unbound predicate.
 
- Public Member Functions inherited from iceberg::ExpressionVisitor< std::shared_ptr< Expression > >
virtual Result< std::shared_ptr< Expression > > Not (ParamType child_result)=0
 Visit a Not expression.
 
virtual Result< std::shared_ptr< Expression > > And (ParamType left_result, ParamType right_result)=0
 Visit an And expression.
 
virtual Result< std::shared_ptr< Expression > > Or (ParamType left_result, ParamType right_result)=0
 Visit an Or expression.
 
virtual Result< std::shared_ptr< Expression > > Aggregate (const std::shared_ptr< BoundAggregate > &aggregate)
 Visit a bound aggregate.
 
virtual Result< std::shared_ptr< Expression > > Aggregate (const std::shared_ptr< UnboundAggregate > &aggregate)
 Visit an unbound aggregate.
 

Static Public Member Functions

static Result< std::shared_ptr< Expression > > Sanitize (const std::shared_ptr< Expression > &expr)
 Sanitize an expression tree and return an unbound expression.
 
static Result< std::shared_ptr< Expression > > Sanitize (const Schema &schema, const std::shared_ptr< Expression > &expr, bool case_sensitive)
 Bind expr to schema first, falling back to sanitizing the unbound expression if binding fails.
 

Detailed Description

Rewrites an expression tree as an unbound expression whose literal values are replaced with type-aware placeholders (e.g. "(2-digit-int)", "(hash-3f9a1c02)", "(date-5-days-ago)").

Member Function Documentation

◆ AlwaysFalse()

Result< std::shared_ptr< Expression > > iceberg::SanitizeExpression::AlwaysFalse ( )
overridevirtual

Visit a False expression (always evaluates to false).

Implements iceberg::ExpressionVisitor< std::shared_ptr< Expression > >.

◆ AlwaysTrue()

Result< std::shared_ptr< Expression > > iceberg::SanitizeExpression::AlwaysTrue ( )
overridevirtual

Visit a True expression (always evaluates to true).

Implements iceberg::ExpressionVisitor< std::shared_ptr< Expression > >.

◆ Predicate() [1/2]

Result< std::shared_ptr< Expression > > iceberg::SanitizeExpression::Predicate ( const std::shared_ptr< BoundPredicate > &  pred)
overridevirtual

Visit a bound predicate.

Parameters
predThe bound predicate to visit

Implements iceberg::ExpressionVisitor< std::shared_ptr< Expression > >.

◆ Predicate() [2/2]

Result< std::shared_ptr< Expression > > iceberg::SanitizeExpression::Predicate ( const std::shared_ptr< UnboundPredicate > &  pred)
overridevirtual

Visit an unbound predicate.

Parameters
predThe unbound predicate to visit

Implements iceberg::ExpressionVisitor< std::shared_ptr< Expression > >.


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