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

Analyzer functions. More...

#include "Analyzer.h"
#include "Catalog/Catalog.h"
#include "Geospatial/Conversion.h"
#include "Geospatial/Types.h"
#include "QueryEngine/DateTimeUtils.h"
#include "RangeTableEntry.h"
#include "Shared/DateConverters.h"
#include "Shared/misc.h"
#include "Shared/sqltypes.h"
#include <algorithm>
#include <cstring>
#include <iostream>
#include <stdexcept>
+ Include dependency graph for Analyzer.cpp:

Go to the source code of this file.

Namespaces

 Analyzer
 
 Analyzer::anonymous_namespace{Analyzer.cpp}
 

Typedefs

using Analyzer::LiteralArgMap = std::map< size_t, std::pair< SQLTypes, Datum >>
 

Functions

bool Analyzer::anonymous_namespace{Analyzer.cpp}::has_same_dict (const SQLTypeInfo &type1, const SQLTypeInfo &type2)
 
SQLTypeInfo Analyzer::anonymous_namespace{Analyzer.cpp}::make_transient_dict_type (SQLTypeInfo sql_type_info_copy)
 
template<typename T >
Analyzer::anonymous_namespace{Analyzer.cpp}::floatFromDecimal (int64_t const dec, unsigned const scale)
 
template<typename FLOAT_TYPE , typename INT_TYPE >
constexpr FLOAT_TYPE Analyzer::anonymous_namespace{Analyzer.cpp}::maxRound ()
 
template<typename TO , typename FROM >
TO Analyzer::anonymous_namespace{Analyzer.cpp}::safeNarrow (FROM const from)
 
template<typename T >
Analyzer::anonymous_namespace{Analyzer.cpp}::roundDecimal (int64_t n, unsigned scale)
 
template<typename TO , typename FROM >
TO Analyzer::anonymous_namespace{Analyzer.cpp}::safeRound (FROM const from)
 
template<typename T >
int64_t Analyzer::anonymous_namespace{Analyzer.cpp}::safeScale (T from, unsigned const scale)
 
bool Analyzer::anonymous_namespace{Analyzer.cpp}::is_null_value (const SQLTypeInfo &ti, const Datum &constval)
 
template<class T >
bool Analyzer::anonymous_namespace{Analyzer.cpp}::expr_is (const std::shared_ptr< Analyzer::Expr > &expr)
 
bool Analyzer::anonymous_namespace{Analyzer.cpp}::is_expr_nullable (const Analyzer::Expr *expr)
 
bool Analyzer::anonymous_namespace{Analyzer.cpp}::is_in_values_nullable (const std::shared_ptr< Analyzer::Expr > &a, const std::list< std::shared_ptr< Analyzer::Expr >> &l)
 
bool Analyzer::Datum_equal (const SQLTypeInfo &ti, Datum val1, Datum val2)
 
int32_t Analyzer::anonymous_namespace{Analyzer.cpp}::ordered_bucket (double const lower_bound, double const upper_bound, int32_t const partition_count, double const value)
 
SQLTypes Analyzer::anonymous_namespace{Analyzer.cpp}::get_ti_from_geo (const Geospatial::GeoBase *geo)
 
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)
 

Detailed Description

Analyzer functions.

Definition in file Analyzer.cpp.

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:

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