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

Fluent APIs to create expressions. More...

#include <expressions.h>

Static Public Member Functions

template<typename... Args>
requires std::conjunction_v<std::is_same<Args, std::shared_ptr<Expression>>...>
static std::shared_ptr< ExpressionAnd (std::shared_ptr< Expression > left, std::shared_ptr< Expression > right, Args &&... args)
 Create an AND expression.
 
template<typename... Args>
requires std::conjunction_v<std::is_same<Args, std::shared_ptr<Expression>>...>
static std::shared_ptr< ExpressionOr (std::shared_ptr< Expression > left, std::shared_ptr< Expression > right, Args &&... args)
 Create an OR expression.
 
static std::shared_ptr< ExpressionNot (std::shared_ptr< Expression > child)
 Create a NOT expression.
 
static std::shared_ptr< UnboundTransformBucket (std::string name, int32_t num_buckets)
 Create a bucket transform term.
 
static std::shared_ptr< UnboundTransformYear (std::string name)
 Create a year transform term.
 
static std::shared_ptr< UnboundTransformMonth (std::string name)
 Create a month transform term.
 
static std::shared_ptr< UnboundTransformDay (std::string name)
 Create a day transform term.
 
static std::shared_ptr< UnboundTransformHour (std::string name)
 Create an hour transform term.
 
static std::shared_ptr< UnboundTransformTruncate (std::string name, int32_t width)
 Create a truncate transform term.
 
static std::shared_ptr< UnboundTransformTransform (std::string name, std::shared_ptr< Transform > transform)
 Create a transform expression.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Count (std::string name)
 Create a COUNT aggregate for a field name.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Count (std::shared_ptr< UnboundTerm< BoundReference > > expr)
 Create a COUNT aggregate for an unbound term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > CountNull (std::string name)
 Create a COUNT_NULL aggregate for a field name.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > CountNull (std::shared_ptr< UnboundTerm< BoundReference > > expr)
 Create a COUNT_NULL aggregate for an unbound term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > CountNotNull (std::string name)
 Create a COUNT_NOT_NULL aggregate for a field name.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > CountNotNull (std::shared_ptr< UnboundTerm< BoundReference > > expr)
 Create a COUNT_NOT_NULL aggregate for an unbound term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > CountStar ()
 Create a COUNT(*) aggregate.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Max (std::string name)
 Create a MAX aggregate for a field name.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Max (std::shared_ptr< UnboundTerm< BoundReference > > expr)
 Create a MAX aggregate for an unbound term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundTransform > > Max (std::shared_ptr< UnboundTerm< BoundTransform > > expr)
 Create a MAX aggregate for an unbound transform term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Min (std::string name)
 Create a MIN aggregate for a field name.
 
static std::shared_ptr< UnboundAggregateImpl< BoundReference > > Min (std::shared_ptr< UnboundTerm< BoundReference > > expr)
 Create a MIN aggregate for an unbound term.
 
static std::shared_ptr< UnboundAggregateImpl< BoundTransform > > Min (std::shared_ptr< UnboundTerm< BoundTransform > > expr)
 Create a MIN aggregate for an unbound transform term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > IsNull (std::string name)
 Create an IS NULL predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > IsNull (std::shared_ptr< UnboundTerm< B > > expr)
 Create an IS NULL predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotNull (std::string name)
 Create a NOT NULL predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotNull (std::shared_ptr< UnboundTerm< B > > expr)
 Create a NOT NULL predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > IsNaN (std::string name)
 Create an IS NaN predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > IsNaN (std::shared_ptr< UnboundTerm< B > > expr)
 Create an IS NaN predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotNaN (std::string name)
 Create a NOT NaN predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotNaN (std::shared_ptr< UnboundTerm< B > > expr)
 Create a NOT NaN predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > LessThan (std::string name, Literal value)
 Create a less than predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > LessThan (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create a less than predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > LessThanOrEqual (std::string name, Literal value)
 Create a less than or equal predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > LessThanOrEqual (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create a less than or equal predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > GreaterThan (std::string name, Literal value)
 Create a greater than predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > GreaterThan (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create a greater than predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > GreaterThanOrEqual (std::string name, Literal value)
 Create a greater than or equal predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > GreaterThanOrEqual (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create a greater than or equal predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > Equal (std::string name, Literal value)
 Create an equal predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > Equal (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create an equal predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotEqual (std::string name, Literal value)
 Create a not equal predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotEqual (std::shared_ptr< UnboundTerm< B > > expr, Literal value)
 Create a not equal predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > StartsWith (std::string name, std::string value)
 Create a starts with predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > StartsWith (std::shared_ptr< UnboundTerm< B > > expr, std::string value)
 Create a starts with predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotStartsWith (std::string name, std::string value)
 Create a not starts with predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotStartsWith (std::shared_ptr< UnboundTerm< B > > expr, std::string value)
 Create a not starts with predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > In (std::string name, std::vector< Literal > values)
 Create an IN predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > In (std::shared_ptr< UnboundTerm< B > > expr, std::vector< Literal > values)
 Create an IN predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > In (std::string name, std::initializer_list< Literal > values)
 Create an IN predicate for a field name with initializer list.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > In (std::shared_ptr< UnboundTerm< B > > expr, std::initializer_list< Literal > values)
 Create an IN predicate for an unbound term with initializer list.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotIn (std::string name, std::vector< Literal > values)
 Create a NOT IN predicate for a field name.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotIn (std::shared_ptr< UnboundTerm< B > > expr, std::vector< Literal > values)
 Create a NOT IN predicate for an unbound term.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > NotIn (std::string name, std::initializer_list< Literal > values)
 Create a NOT IN predicate for a field name with initializer list.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > NotIn (std::shared_ptr< UnboundTerm< B > > expr, std::initializer_list< Literal > values)
 Create a NOT IN predicate for an unbound term with initializer list.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > Predicate (Expression::Operation op, std::string name, Literal value)
 Create a predicate with operation and single value.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > Predicate (Expression::Operation op, std::string name, std::vector< Literal > values)
 Create a predicate with operation and multiple values.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > Predicate (Expression::Operation op, std::string name, std::initializer_list< Literal > values)
 Create a predicate with operation and multiple values.
 
static std::shared_ptr< UnboundPredicateImpl< BoundReference > > Predicate (Expression::Operation op, std::string name)
 Create a unary predicate (no values).
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > Predicate (Expression::Operation op, std::shared_ptr< UnboundTerm< B > > expr, std::vector< Literal > values)
 Create a predicate for unbound term with multiple values.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > Predicate (Expression::Operation op, std::shared_ptr< UnboundTerm< B > > expr, std::initializer_list< Literal > values)
 Create a predicate with operation and multiple values.
 
template<typename B >
static std::shared_ptr< UnboundPredicateImpl< B > > Predicate (Expression::Operation op, std::shared_ptr< UnboundTerm< B > > expr)
 Create a unary predicate for unbound term.
 
static std::shared_ptr< TrueAlwaysTrue ()
 Return the always true expression.
 
static std::shared_ptr< FalseAlwaysFalse ()
 Return the always false expression.
 
static std::shared_ptr< NamedReferenceRef (std::string name)
 Create a named reference to a field.
 
static Literal Lit (Literal::Value value, std::shared_ptr< PrimitiveType > type)
 Create a literal from a value.
 

Detailed Description

Fluent APIs to create expressions.

Exceptions
`ExpressionError`for invalid expression.

Member Function Documentation

◆ Not()

std::shared_ptr< Expression > iceberg::Expressions::Not ( std::shared_ptr< Expression child)
static

Create a NOT expression.

Parameters
childThe expression to negate
Returns
A negated expression with optimizations applied:
  • not(true) returns false
  • not(false) returns true
  • not(not(x)) returns x

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