OmniSciDB  cde582ebc3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Analyzer.h File Reference

Defines data structures for the semantic analysis phase of query processing. More...

#include "Geospatial/Types.h"
#include "Logger/Logger.h"
#include "Shared/sqldefs.h"
#include "Shared/sqltypes.h"
#include <cstdint>
#include <iostream>
#include <list>
#include <map>
#include <optional>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
+ Include dependency graph for Analyzer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Analyzer::Expr
 
class  Analyzer::ColumnVar
 
class  Analyzer::ExpressionTuple
 
class  Analyzer::Var
 
class  Analyzer::Constant
 
class  Analyzer::UOper
 
class  Analyzer::BinOper
 
class  Analyzer::RangeOper
 
class  Analyzer::Subquery
 
class  Analyzer::InValues
 
class  Analyzer::InIntegerSet
 
class  Analyzer::CharLengthExpr
 
class  Analyzer::KeyForStringExpr
 
class  Analyzer::SampleRatioExpr
 
class  Analyzer::CardinalityExpr
 
class  Analyzer::LikeExpr
 
class  Analyzer::RegexpExpr
 
class  Analyzer::WidthBucketExpr
 
class  Analyzer::LikelihoodExpr
 
class  Analyzer::AggExpr
 
class  Analyzer::CaseExpr
 
class  Analyzer::ExtractExpr
 
class  Analyzer::DateaddExpr
 
class  Analyzer::DatediffExpr
 
class  Analyzer::DatetruncExpr
 
class  Analyzer::StringOper
 Expression class for string functions The "arg" constructor parameter must be an expression that resolves to a string datatype (e.g. TEXT). More...
 
class  Analyzer::LowerStringOper
 
class  Analyzer::UpperStringOper
 
class  Analyzer::InitCapStringOper
 
class  Analyzer::ReverseStringOper
 
class  Analyzer::RepeatStringOper
 
class  Analyzer::ConcatStringOper
 
class  Analyzer::PadStringOper
 
class  Analyzer::TrimStringOper
 
class  Analyzer::SubstringStringOper
 
class  Analyzer::OverlayStringOper
 
class  Analyzer::ReplaceStringOper
 
class  Analyzer::SplitPartStringOper
 
class  Analyzer::RegexpReplaceStringOper
 
class  Analyzer::RegexpSubstrStringOper
 
class  Analyzer::FunctionOper
 
class  Analyzer::FunctionOperWithCustomTypeHandling
 
class  Analyzer::OffsetInFragment
 
struct  Analyzer::OrderEntry
 
class  Analyzer::WindowFrame
 
class  Analyzer::WindowFunction
 
class  Analyzer::ArrayExpr
 
class  Analyzer::GeoUOper
 
class  Analyzer::GeoBinOper
 
class  Analyzer::TargetEntry
 
class  Analyzer::Query
 
class  Analyzer::GeoExpr
 
class  Analyzer::GeoColumnVar
 
class  Analyzer::GeoConstant
 
class  Analyzer::GeoOperator
 
class  Analyzer::GeoTransformOperator
 

Namespaces

 Analyzer
 
 Catalog_Namespace
 

Typedefs

using Analyzer::DomainSet = std::list< const Expr * >
 
using Analyzer::ExpressionPtr = std::shared_ptr< Analyzer::Expr >
 
using Analyzer::ExpressionPtrList = std::list< ExpressionPtr >
 
using Analyzer::ExpressionPtrVector = std::vector< ExpressionPtr >
 

Functions

template<typename Tp , typename... Args>
std::enable_if
< std::is_base_of
< Analyzer::Expr, Tp >::value,
std::shared_ptr< Tp > >::type 
makeExpr (Args &&...args)
 
std::shared_ptr< Analyzer::Varvar_ref (const Analyzer::Expr *expr, const Analyzer::Var::WhichRow which_row, const int varno)
 
bool expr_list_match (const std::vector< std::shared_ptr< Analyzer::Expr >> &lhs, const std::vector< std::shared_ptr< Analyzer::Expr >> &rhs)
 
std::shared_ptr< Analyzer::Exprremove_cast (const std::shared_ptr< Analyzer::Expr > &expr)
 
const Analyzer::Exprremove_cast (const Analyzer::Expr *expr)
 

Variables

bool g_enable_string_functions
 

Detailed Description

Defines data structures for the semantic analysis phase of query processing.

Definition in file Analyzer.h.

Function Documentation

bool expr_list_match ( const std::vector< std::shared_ptr< Analyzer::Expr >> &  lhs,
const std::vector< std::shared_ptr< Analyzer::Expr >> &  rhs 
)

Definition at line 4183 of file Analyzer.cpp.

Referenced by Analyzer::ExpressionTuple::operator==(), Analyzer::WindowFunction::operator==(), Analyzer::GeoUOper::operator==(), Analyzer::GeoBinOper::operator==(), rewrite_avg_window(), and anonymous_namespace{WindowExpressionRewrite.cpp}::window_sum_and_count_match().

4184  {
4185  if (lhs.size() != rhs.size()) {
4186  return false;
4187  }
4188  for (size_t i = 0; i < lhs.size(); ++i) {
4189  if (!(*lhs[i] == *rhs[i])) {
4190  return false;
4191  }
4192  }
4193  return true;
4194 }

+ Here is the caller graph for this function:

template<typename Tp , typename... Args>
std::enable_if<std::is_base_of<Analyzer::Expr, Tp>::value, std::shared_ptr<Tp> >::type makeExpr ( Args &&...  args)
inline

Definition at line 55 of file Analyzer.h.

References run_benchmark_import::args.

55  {
56  return std::make_shared<Tp>(std::forward<Args>(args)...);
57 }
std::shared_ptr<Analyzer::Expr> remove_cast ( const std::shared_ptr< Analyzer::Expr > &  expr)

Definition at line 4196 of file Analyzer.cpp.

References Analyzer::UOper::get_own_operand(), and kCAST.

Referenced by anonymous_namespace{EquiJoinCondition.cpp}::can_combine_with(), Analyzer::StringOper::check_operand_types(), CodeGenerator::codegenPerRowStringOper(), getExpressionRange(), anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals_impl(), rewrite_sum_window(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitStringOper().

4196  {
4197  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr.get());
4198  if (!uoper || uoper->get_optype() != kCAST) {
4199  return expr;
4200  }
4201  return uoper->get_own_operand();
4202 }
const std::shared_ptr< Analyzer::Expr > get_own_operand() const
Definition: Analyzer.h:379
Definition: sqldefs.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Analyzer::Expr* remove_cast ( const Analyzer::Expr expr)

Definition at line 4204 of file Analyzer.cpp.

References kCAST.

4204  {
4205  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr);
4206  if (!uoper || uoper->get_optype() != kCAST) {
4207  return expr;
4208  }
4209  return uoper->get_operand();
4210 }
Definition: sqldefs.h:48
std::shared_ptr<Analyzer::Var> var_ref ( const Analyzer::Expr expr,
const Analyzer::Var::WhichRow  which_row,
const int  varno 
)
inline

Definition at line 2700 of file Analyzer.h.

References Analyzer::ColumnVar::get_table_id(), and Analyzer::Expr::get_type_info().

Referenced by anonymous_namespace{RelAlgExecutor.cpp}::translate_targets().

2702  {
2703  const auto col_expr = dynamic_cast<const Analyzer::ColumnVar*>(expr);
2704  const int table_id = col_expr ? col_expr->get_table_id() : 0;
2705  const int column_id = col_expr ? col_expr->get_column_id() : 0;
2706  const int rte_idx = col_expr ? col_expr->get_rte_idx() : -1;
2707  return makeExpr<Analyzer::Var>(
2708  expr->get_type_info(), table_id, column_id, rte_idx, which_row, varno);
2709 }
int get_table_id() const
Definition: Analyzer.h:200
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:81

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation