OmniSciDB  a5dc49c757
 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/DbObjectKeys.h"
#include "Shared/sqldefs.h"
#include "Shared/sqltypes.h"
#include <algorithm>
#include <cstdint>
#include <functional>
#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::MLPredictExpr
 
class  Analyzer::PCAProjectExpr
 
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::RegexpCountStringOper
 
class  Analyzer::JsonValueStringOper
 
class  Analyzer::Base64EncodeStringOper
 
class  Analyzer::Base64DecodeStringOper
 
class  Analyzer::UrlEncodeStringOper
 
class  Analyzer::UrlDecodeStringOper
 
class  Analyzer::TryStringCastOper
 
class  Analyzer::PositionStringOper
 
class  Analyzer::JarowinklerSimilarityStringOper
 
class  Analyzer::LevenshteinDistanceStringOper
 
class  Analyzer::HashStringOper
 
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
 

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 4598 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().

4599  {
4600  if (lhs.size() != rhs.size()) {
4601  return false;
4602  }
4603  for (size_t i = 0; i < lhs.size(); ++i) {
4604  if (!(*lhs[i] == *rhs[i])) {
4605  return false;
4606  }
4607  }
4608  return true;
4609 }

+ 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 53 of file Analyzer.h.

References run_benchmark_import::args.

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

Definition at line 4611 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(), Analyzer::StringOper::get_return_type(), anonymous_namespace{EquiJoinCondition.cpp}::make_composite_equals_impl(), and rewrite_sum_window().

4611  {
4612  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr.get());
4613  if (!uoper || uoper->get_optype() != kCAST) {
4614  return expr;
4615  }
4616  return uoper->get_own_operand();
4617 }
const std::shared_ptr< Analyzer::Expr > get_own_operand() const
Definition: Analyzer.h:385
Definition: sqldefs.h:51

+ 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 4619 of file Analyzer.cpp.

References kCAST.

4619  {
4620  const auto uoper = dynamic_cast<const Analyzer::UOper*>(expr);
4621  if (!uoper || uoper->get_optype() != kCAST) {
4622  return expr;
4623  }
4624  return uoper->get_operand();
4625 }
Definition: sqldefs.h:51
std::shared_ptr<Analyzer::Var> var_ref ( const Analyzer::Expr expr,
const Analyzer::Var::WhichRow  which_row,
const int  varno 
)
inline

Definition at line 3348 of file Analyzer.h.

References Analyzer::Expr::get_type_info().

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

3350  {
3351  const auto col_expr = dynamic_cast<const Analyzer::ColumnVar*>(expr);
3352  const shared::ColumnKey& column_key =
3353  col_expr ? col_expr->getColumnKey() : shared::ColumnKey{0, 0, 0};
3354  const int rte_idx = col_expr ? col_expr->get_rte_idx() : -1;
3355  return makeExpr<Analyzer::Var>(
3356  expr->get_type_info(), column_key, rte_idx, which_row, varno);
3357 }
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:79

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation