Project
Loading...
Searching...
No Matches
o2::framework::expressions Namespace Reference

Classes

struct  BindingNode
 An expression tree node corresponding to a column binding. More...
 
struct  ColumnOperationSpec
 
struct  ConditionalNode
 A conditional node. More...
 
struct  DatumSpec
 
struct  Filter
 A struct, containing the root of the expression tree. More...
 
struct  LiteralNode
 An expression tree node corresponding to a literal value. More...
 
struct  LiteralStorage
 
struct  Node
 A generic tree node. More...
 
struct  NodeRecord
 helper struct used to parse trees More...
 
struct  OpNode
 An expression tree node corresponding to binary or unary operation. More...
 
struct  PlaceholderNode
 A placeholder node for simple type configurable. More...
 

Concepts

concept  is_filter
 

Typedefs

using LiteralValue = LiteralStorage< int, bool, float, double, uint8_t, int64_t, int16_t, uint16_t, int8_t, uint32_t, uint64_t >
 
using Projector = Filter
 
using Operations = std::vector< ColumnOperationSpec >
 

Functions

bool operator== (DatumSpec const &lhs, DatumSpec const &rhs)
 
std::ostream & operator<< (std::ostream &os, DatumSpec const &spec)
 
const charstringType (atype::type t)
 
template<typename T >
constexpr auto selectArrowType ()
 
 SELECT_ARROW_TYPE (bool, BOOL)
 
 SELECT_ARROW_TYPE (float, FLOAT)
 
 SELECT_ARROW_TYPE (double, DOUBLE)
 
 SELECT_ARROW_TYPE (uint8_t, UINT8)
 
 SELECT_ARROW_TYPE (int8_t, INT8)
 
 SELECT_ARROW_TYPE (uint16_t, UINT16)
 
 SELECT_ARROW_TYPE (int16_t, INT16)
 
 SELECT_ARROW_TYPE (uint32_t, UINT32)
 
 SELECT_ARROW_TYPE (int32_t, INT32)
 
 SELECT_ARROW_TYPE (uint64_t, UINT64)
 
 SELECT_ARROW_TYPE (int64_t, INT64)
 
std::shared_ptr< arrow::DataType > concreteArrowType (atype::type type)
 
std::string upcastTo (atype::type f)
 
 BINARY_OP_NODES (|, BitwiseOr)
 
 BINARY_OP_NODES (+, Addition)
 
 BINARY_OP_NODES (-, Subtraction)
 
 BINARY_OP_NODES (/, Division)
 
 BINARY_OP_NODES (>, GreaterThan)
 
 BINARY_OP_NODES (>=, GreaterThanOrEqual)
 
 BINARY_OP_NODES (<, LessThan)
 
 BINARY_OP_NODES (<=, LessThanOrEqual)
 
 BINARY_OP_NODES (==, Equal)
 
 BINARY_OP_NODES (!=, NotEqual)
 
 BINARY_OP_NODES (||, LogicalOr)
 
template<typename T >
requires (std::is_arithmetic_v<T>)
Node npow (Node &&left, T right)
 functions
 
 BINARY_FUNC_NODES (Atan2, natan2)
 
 UNARY_FUNC_NODES (Round, nround)
 
 UNARY_FUNC_NODES (Sqrt, nsqrt)
 
 UNARY_FUNC_NODES (Exp, nexp)
 
 UNARY_FUNC_NODES (Log, nlog)
 
 UNARY_FUNC_NODES (Log10, nlog10)
 
 UNARY_FUNC_NODES (Abs, nabs)
 
 UNARY_FUNC_NODES (Sin, nsin)
 
 UNARY_FUNC_NODES (Cos, ncos)
 
 UNARY_FUNC_NODES (Tan, ntan)
 
 UNARY_FUNC_NODES (Asin, nasin)
 
 UNARY_FUNC_NODES (Acos, nacos)
 
 UNARY_FUNC_NODES (Atan, natan)
 
 UNARY_FUNC_NODES (BitwiseNot, nbitwise_not)
 
Node ifnode (Node &&condition_, Node &&then_, Node &&else_)
 conditionals
 
template<typename L >
requires (std::is_arithmetic_v<L>)
Node ifnode (Node &&condition_, Node &&then_, L else_)
 
template<typename L >
requires (std::is_arithmetic_v<L>)
Node ifnode (Node &&condition_, L then_, Node &&else_)
 
template<typename L1 , typename L2 >
requires (std::is_arithmetic_v<L1>&& std::is_arithmetic_v<L2>)
Node ifnode (Node &&condition_, L1 then_, L2 else_)
 
template<typename T >
Node ifnode (Configurable< T > const &condition_, Node &&then_, Node &&else_)
 
template<typename L >
Node ifnode (Node &&condition_, Node &&then_, Configurable< L > const &else_)
 
template<typename L >
Node ifnode (Node &&condition_, Configurable< L > const &then_, Node &&else_)
 
template<typename L1 , typename L2 >
Node ifnode (Node &&condition_, Configurable< L1 > const &then_, Configurable< L2 > const &else_)
 
gandiva::Selection createSelection (std::shared_ptr< arrow::Table > const &table, Filter const &expression)
 Function for creating gandiva selection from our internal filter tree.
 
gandiva::Selection createSelection (std::shared_ptr< arrow::Table > const &table, std::shared_ptr< gandiva::Filter > const &gfilter)
 Function for creating gandiva selection from prepared gandiva expressions tree.
 
Operations createOperations (Filter const &expression)
 Function to create an internal operation sequence from a filter tree.
 
bool isTableCompatible (std::set< uint32_t > const &hashes, Operations const &specs)
 Function to check compatibility of a given arrow schema with operation sequence.
 
gandiva::NodePtr createExpressionTree (Operations const &opSpecs, gandiva::SchemaPtr const &Schema)
 Function to create gandiva expression tree from operation sequence.
 
std::shared_ptr< gandiva::Filter > createFilter (gandiva::SchemaPtr const &Schema, gandiva::ConditionPtr condition)
 Function to create gandiva filter from gandiva condition.
 
std::shared_ptr< gandiva::Filter > createFilter (gandiva::SchemaPtr const &Schema, Operations const &opSpecs)
 Function to create gandiva filter from operation sequence.
 
std::shared_ptr< gandiva::Projector > createProjector (gandiva::SchemaPtr const &Schema, Operations const &opSpecs, gandiva::FieldPtr result)
 Function to create gandiva projector from operation sequence.
 
std::shared_ptr< gandiva::Projector > createProjector (gandiva::SchemaPtr const &Schema, Projector &&p, gandiva::FieldPtr result)
 Function to create gandiva projector directly from expression.
 
void updateExpressionInfos (expressions::Filter const &filter, std::vector< ExpressionInfo > &eInfos)
 Function for attaching gandiva filters to to compatible task inputs.
 
gandiva::ConditionPtr makeCondition (gandiva::NodePtr node)
 Function to create gandiva condition expression from generic gandiva expression tree.
 
gandiva::ExpressionPtr makeExpression (gandiva::NodePtr node, gandiva::FieldPtr result)
 Function to create gandiva projecting expression from generic gandiva expression tree.
 
void updatePlaceholders (Filter &filter, InitContext &context)
 Update placeholder nodes from context.
 
template<typename... C>
std::vector< expressions::ProjectormakeProjectors (framework::pack< C... >)
 
std::shared_ptr< gandiva::Projector > createProjectorHelper (size_t nColumns, expressions::Projector *projectors, std::shared_ptr< arrow::Schema > schema, std::vector< std::shared_ptr< arrow::Field > > const &fields)
 
template<typename... C>
std::shared_ptr< gandiva::Projector > createProjectors (framework::pack< C... >, std::vector< std::shared_ptr< arrow::Field > > const &fields, gandiva::SchemaPtr schema)
 
void updateFilterInfo (ExpressionInfo &info, std::shared_ptr< arrow::Table > &table)
 
auto createProjection (std::shared_ptr< arrow::Table > const &table, std::shared_ptr< gandiva::Projector > const &gprojector)
 

Variables

BINARY_OP_NODESBitwiseAnd
 
BINARY_OP_NODESBitwiseXor
 
BINARY_OP_NODESMultiplication
 
BINARY_OP_NODES && LogicalAnd
 

Typedef Documentation

◆ LiteralValue

using o2::framework::expressions::LiteralValue = typedef LiteralStorage<int, bool, float, double, uint8_t, int64_t, int16_t, uint16_t, int8_t, uint32_t, uint64_t>

Definition at line 79 of file Expressions.h.

◆ Operations

Definition at line 432 of file Expressions.h.

◆ Projector

Definition at line 424 of file Expressions.h.

Function Documentation

◆ BINARY_FUNC_NODES()

o2::framework::expressions::BINARY_FUNC_NODES ( Atan2  ,
natan2   
)

◆ BINARY_OP_NODES() [1/11]

o2::framework::expressions::BINARY_OP_NODES ( ,
NotEqual   
)

◆ BINARY_OP_NODES() [2/11]

o2::framework::expressions::BINARY_OP_NODES ( ,
Addition   
)

◆ BINARY_OP_NODES() [3/11]

o2::framework::expressions::BINARY_OP_NODES ( ,
Subtraction   
)

◆ BINARY_OP_NODES() [4/11]

o2::framework::expressions::BINARY_OP_NODES ( ,
Division   
)

◆ BINARY_OP_NODES() [5/11]

o2::framework::expressions::BINARY_OP_NODES ( )

◆ BINARY_OP_NODES() [6/11]

o2::framework::expressions::BINARY_OP_NODES ( <=  ,
LessThanOrEqual   
)

◆ BINARY_OP_NODES() [7/11]

o2::framework::expressions::BINARY_OP_NODES ( Equal  )

◆ BINARY_OP_NODES() [8/11]

o2::framework::expressions::BINARY_OP_NODES ( GreaterThan  )

◆ BINARY_OP_NODES() [9/11]

o2::framework::expressions::BINARY_OP_NODES ( >=  ,
GreaterThanOrEqual   
)

◆ BINARY_OP_NODES() [10/11]

o2::framework::expressions::BINARY_OP_NODES ( ,
BitwiseOr   
)

◆ BINARY_OP_NODES() [11/11]

o2::framework::expressions::BINARY_OP_NODES ( ||  ,
LogicalOr   
)

◆ concreteArrowType()

std::shared_ptr< arrow::DataType > o2::framework::expressions::concreteArrowType ( atype::type  type)

Definition at line 123 of file Expressions.cxx.

◆ createExpressionTree()

gandiva::NodePtr o2::framework::expressions::createExpressionTree ( Operations const &  opSpecs,
gandiva::SchemaPtr const &  Schema 
)

Function to create gandiva expression tree from operation sequence.

Definition at line 572 of file Expressions.cxx.

◆ createFilter() [1/2]

std::shared_ptr< gandiva::Filter > o2::framework::expressions::createFilter ( gandiva::SchemaPtr const &  Schema,
gandiva::ConditionPtr  condition 
)

Function to create gandiva filter from gandiva condition.

Definition at line 457 of file Expressions.cxx.

◆ createFilter() [2/2]

std::shared_ptr< gandiva::Filter > o2::framework::expressions::createFilter ( gandiva::SchemaPtr const &  Schema,
Operations const &  opSpecs 
)

Function to create gandiva filter from operation sequence.

Definition at line 444 of file Expressions.cxx.

◆ createOperations()

Operations o2::framework::expressions::createOperations ( Filter const &  expression)

Function to create an internal operation sequence from a filter tree.

Definition at line 256 of file Expressions.cxx.

◆ createProjection()

auto o2::framework::expressions::createProjection ( std::shared_ptr< arrow::Table > const &  table,
std::shared_ptr< gandiva::Projector > const &  gprojector 
)

Definition at line 551 of file Expressions.cxx.

◆ createProjector() [1/2]

std::shared_ptr< gandiva::Projector > o2::framework::expressions::createProjector ( gandiva::SchemaPtr const &  Schema,
Operations const &  opSpecs,
gandiva::FieldPtr  result 
)

Function to create gandiva projector from operation sequence.

Definition at line 470 of file Expressions.cxx.

◆ createProjector() [2/2]

std::shared_ptr< gandiva::Projector > o2::framework::expressions::createProjector ( gandiva::SchemaPtr const &  Schema,
Projector &&  p,
gandiva::FieldPtr  result 
)

Function to create gandiva projector directly from expression.

Definition at line 483 of file Expressions.cxx.

◆ createProjectorHelper()

std::shared_ptr< gandiva::Projector > o2::framework::expressions::createProjectorHelper ( size_t  nColumns,
expressions::Projector projectors,
std::shared_ptr< arrow::Schema >  schema,
std::vector< std::shared_ptr< arrow::Field > > const &  fields 
)

Definition at line 488 of file Expressions.cxx.

◆ createProjectors()

template<typename... C>
std::shared_ptr< gandiva::Projector > o2::framework::expressions::createProjectors ( framework::pack< C... >  ,
std::vector< std::shared_ptr< arrow::Field > > const &  fields,
gandiva::SchemaPtr  schema 
)

Definition at line 476 of file Expressions.h.

◆ createSelection() [1/2]

gandiva::Selection o2::framework::expressions::createSelection ( std::shared_ptr< arrow::Table > const &  table,
Filter const &  expression 
)

Function for creating gandiva selection from our internal filter tree.

Definition at line 545 of file Expressions.cxx.

◆ createSelection() [2/2]

gandiva::Selection o2::framework::expressions::createSelection ( std::shared_ptr< arrow::Table > const &  table,
std::shared_ptr< gandiva::Filter > const &  gfilter 
)

Function for creating gandiva selection from prepared gandiva expressions tree.

Definition at line 514 of file Expressions.cxx.

◆ ifnode() [1/8]

template<typename T >
Node o2::framework::expressions::ifnode ( Configurable< T > const &  condition_,
Node &&  then_,
Node &&  else_ 
)
inline

Definition at line 382 of file Expressions.h.

◆ ifnode() [2/8]

template<typename L >
Node o2::framework::expressions::ifnode ( Node &&  condition_,
Configurable< L > const &  then_,
Node &&  else_ 
)
inline

Definition at line 394 of file Expressions.h.

◆ ifnode() [3/8]

template<typename L1 , typename L2 >
Node o2::framework::expressions::ifnode ( Node &&  condition_,
Configurable< L1 > const &  then_,
Configurable< L2 > const &  else_ 
)
inline

Definition at line 400 of file Expressions.h.

◆ ifnode() [4/8]

template<typename L >
requires (std::is_arithmetic_v<L>)
Node o2::framework::expressions::ifnode ( Node &&  condition_,
then_,
Node &&  else_ 
)
inline

Definition at line 370 of file Expressions.h.

◆ ifnode() [5/8]

template<typename L1 , typename L2 >
requires (std::is_arithmetic_v<L1>&& std::is_arithmetic_v<L2>)
Node o2::framework::expressions::ifnode ( Node &&  condition_,
L1  then_,
L2  else_ 
)
inline

Definition at line 376 of file Expressions.h.

◆ ifnode() [6/8]

template<typename L >
Node o2::framework::expressions::ifnode ( Node &&  condition_,
Node &&  then_,
Configurable< L > const &  else_ 
)
inline

Definition at line 388 of file Expressions.h.

◆ ifnode() [7/8]

template<typename L >
requires (std::is_arithmetic_v<L>)
Node o2::framework::expressions::ifnode ( Node &&  condition_,
Node &&  then_,
else_ 
)
inline

Definition at line 364 of file Expressions.h.

◆ ifnode() [8/8]

Node o2::framework::expressions::ifnode ( Node &&  condition_,
Node &&  then_,
Node &&  else_ 
)
inline

conditionals

Definition at line 358 of file Expressions.h.

◆ isTableCompatible()

bool o2::framework::expressions::isTableCompatible ( std::set< uint32_t > const &  hashes,
Operations const &  specs 
)

Function to check compatibility of a given arrow schema with operation sequence.

Definition at line 703 of file Expressions.cxx.

◆ makeCondition()

gandiva::ConditionPtr o2::framework::expressions::makeCondition ( gandiva::NodePtr  node)

Function to create gandiva condition expression from generic gandiva expression tree.

Definition at line 433 of file Expressions.cxx.

◆ makeExpression()

gandiva::ExpressionPtr o2::framework::expressions::makeExpression ( gandiva::NodePtr  node,
gandiva::FieldPtr  result 
)

Function to create gandiva projecting expression from generic gandiva expression tree.

Definition at line 438 of file Expressions.cxx.

◆ makeProjectors()

template<typename... C>
std::vector< expressions::Projector > o2::framework::expressions::makeProjectors ( framework::pack< C... >  )

Definition at line 466 of file Expressions.h.

◆ npow()

template<typename T >
requires (std::is_arithmetic_v<T>)
Node o2::framework::expressions::npow ( Node &&  left,
right 
)
inline

functions

Definition at line 277 of file Expressions.h.

◆ operator<<()

std::ostream & o2::framework::expressions::operator<< ( std::ostream &  os,
DatumSpec const &  spec 
)

Definition at line 174 of file Expressions.cxx.

◆ operator==()

bool o2::framework::expressions::operator== ( DatumSpec const &  lhs,
DatumSpec const &  rhs 
)

Definition at line 169 of file Expressions.cxx.

◆ SELECT_ARROW_TYPE() [1/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( bool  ,
BOOL   
)

◆ SELECT_ARROW_TYPE() [2/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( double  ,
DOUBLE   
)

◆ SELECT_ARROW_TYPE() [3/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( float  ,
FLOAT   
)

◆ SELECT_ARROW_TYPE() [4/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( int16_t  ,
INT16   
)

◆ SELECT_ARROW_TYPE() [5/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( int32_t  ,
INT32   
)

◆ SELECT_ARROW_TYPE() [6/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( int64_t  ,
INT64   
)

◆ SELECT_ARROW_TYPE() [7/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( int8_t  ,
INT8   
)

◆ SELECT_ARROW_TYPE() [8/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( uint16_t  ,
UINT16   
)

◆ SELECT_ARROW_TYPE() [9/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( uint32_t  ,
UINT32   
)

◆ SELECT_ARROW_TYPE() [10/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( uint64_t  ,
UINT64   
)

◆ SELECT_ARROW_TYPE() [11/11]

o2::framework::expressions::SELECT_ARROW_TYPE ( uint8_t  ,
UINT8   
)

◆ selectArrowType()

template<typename T >
constexpr auto o2::framework::expressions::selectArrowType ( )
constexpr

Definition at line 82 of file Expressions.h.

◆ stringType()

const char * o2::framework::expressions::stringType ( atype::type  t)

Definition at line 225 of file Expressions.cxx.

◆ UNARY_FUNC_NODES() [1/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Abs  ,
nabs   
)

◆ UNARY_FUNC_NODES() [2/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Acos  ,
nacos   
)

◆ UNARY_FUNC_NODES() [3/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Asin  ,
nasin   
)

◆ UNARY_FUNC_NODES() [4/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Atan  ,
natan   
)

◆ UNARY_FUNC_NODES() [5/13]

o2::framework::expressions::UNARY_FUNC_NODES ( BitwiseNot  ,
nbitwise_not   
)

◆ UNARY_FUNC_NODES() [6/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Cos  ,
ncos   
)

◆ UNARY_FUNC_NODES() [7/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Exp  ,
nexp   
)

◆ UNARY_FUNC_NODES() [8/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Log  ,
nlog   
)

◆ UNARY_FUNC_NODES() [9/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Log10  ,
nlog10   
)

◆ UNARY_FUNC_NODES() [10/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Round  ,
nround   
)

◆ UNARY_FUNC_NODES() [11/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Sin  ,
nsin   
)

◆ UNARY_FUNC_NODES() [12/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Sqrt  ,
nsqrt   
)

◆ UNARY_FUNC_NODES() [13/13]

o2::framework::expressions::UNARY_FUNC_NODES ( Tan  ,
ntan   
)

◆ upcastTo()

std::string o2::framework::expressions::upcastTo ( atype::type  f)

Definition at line 153 of file Expressions.cxx.

◆ updateExpressionInfos()

void o2::framework::expressions::updateExpressionInfos ( expressions::Filter const &  filter,
std::vector< ExpressionInfo > &  eInfos 
)

Function for attaching gandiva filters to to compatible task inputs.

If the tree is already set, add a new tree to it with logical 'and'

If the tree is already set, add a new tree to it with logical 'and'

Definition at line 719 of file Expressions.cxx.

◆ updateFilterInfo()

void o2::framework::expressions::updateFilterInfo ( ExpressionInfo info,
std::shared_ptr< arrow::Table > &  table 
)

Definition at line 738 of file Expressions.cxx.

◆ updatePlaceholders()

void o2::framework::expressions::updatePlaceholders ( Filter filter,
InitContext context 
)

Update placeholder nodes from context.

Definition at line 190 of file Expressions.cxx.

Variable Documentation

◆ BitwiseAnd

BINARY_OP_NODES& o2::framework::expressions::BitwiseAnd

Definition at line 259 of file Expressions.h.

◆ BitwiseXor

BINARY_OP_NODES^ o2::framework::expressions::BitwiseXor

Definition at line 260 of file Expressions.h.

◆ LogicalAnd

BINARY_OP_NODES&& o2::framework::expressions::LogicalAnd

Definition at line 272 of file Expressions.h.

◆ Multiplication

BINARY_OP_NODES* o2::framework::expressions::Multiplication

Definition at line 264 of file Expressions.h.