OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Analyzer::GeoBinOper Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::GeoBinOper:
+ Collaboration diagram for Analyzer::GeoBinOper:

Public Member Functions

 GeoBinOper (const Geospatial::GeoBase::GeoOp op, const SQLTypeInfo &ti, const SQLTypeInfo &ti0, const SQLTypeInfo &ti1, const std::vector< std::shared_ptr< Analyzer::Expr >> &args0, const std::vector< std::shared_ptr< Analyzer::Expr >> &args1)
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () const override
 
Geospatial::GeoBase::GeoOp getOp () const
 
const SQLTypeInfo getTypeInfo0 () const
 
const SQLTypeInfo getTypeInfo1 () const
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > & 
getArgs0 () const
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > & 
getArgs1 () const
 
- Public Member Functions inherited from Analyzer::Expr
 Expr (SQLTypes t, bool notnull)
 
 Expr (SQLTypes t, int d, bool notnull)
 
 Expr (SQLTypes t, int d, int s, bool notnull)
 
 Expr (const SQLTypeInfo &ti, bool has_agg=false)
 
virtual ~Expr ()
 
std::shared_ptr< Analyzer::Exprget_shared_ptr ()
 
const SQLTypeInfoget_type_info () const
 
void set_type_info (const SQLTypeInfo &ti)
 
bool get_contains_agg () const
 
void set_contains_agg (bool a)
 
virtual std::shared_ptr
< Analyzer::Expr
add_cast (const SQLTypeInfo &new_type_info)
 
virtual void check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const
 
virtual std::shared_ptr
< Analyzer::Expr
normalize_simple_predicate (int &rte_idx) const
 
virtual void group_predicates (std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const
 
virtual void collect_rte_idx (std::set< int > &rte_idx_set) const
 
virtual void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const
 
virtual size_t get_num_column_vars (const bool include_agg) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr
< Analyzer::Expr
rewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual void print () const
 
virtual void add_unique (std::list< const Expr * > &expr_list) const
 
virtual void find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Private Attributes

const Geospatial::GeoBase::GeoOp op_
 
SQLTypeInfo ti0_
 
SQLTypeInfo ti1_
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > 
args0_
 
const std::vector
< std::shared_ptr
< Analyzer::Expr > > 
args1_
 

Additional Inherited Members

- Protected Attributes inherited from Analyzer::Expr
SQLTypeInfo type_info
 
bool contains_agg
 

Detailed Description

Definition at line 2713 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::GeoBinOper::GeoBinOper ( const Geospatial::GeoBase::GeoOp  op,
const SQLTypeInfo ti,
const SQLTypeInfo ti0,
const SQLTypeInfo ti1,
const std::vector< std::shared_ptr< Analyzer::Expr >> &  args0,
const std::vector< std::shared_ptr< Analyzer::Expr >> &  args1 
)
inline

Definition at line 2715 of file Analyzer.h.

2721  : Expr(ti), op_(op), ti0_(ti0), ti1_(ti1), args0_(args0), args1_(args1){};
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:74
SQLTypeInfo ti0_
Definition: Analyzer.h:2736
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:2738
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:2735
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:2739
SQLTypeInfo ti1_
Definition: Analyzer.h:2737

Member Function Documentation

std::shared_ptr< Analyzer::Expr > Analyzer::GeoBinOper::deep_copy ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 246 of file Analyzer.cpp.

References args0_, args1_, op_, ti0_, ti1_, and Analyzer::Expr::type_info.

246  {
247  return makeExpr<GeoBinOper>(op_, type_info, ti0_, ti1_, args0_, args1_);
248 }
SQLTypeInfo ti0_
Definition: Analyzer.h:2736
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:2738
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:2735
SQLTypeInfo type_info
Definition: Analyzer.h:184
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:2739
SQLTypeInfo ti1_
Definition: Analyzer.h:2737
const std::vector<std::shared_ptr<Analyzer::Expr> >& Analyzer::GeoBinOper::getArgs0 ( ) const
inline

Definition at line 2731 of file Analyzer.h.

References args0_.

Referenced by CodeGenerator::codegenGeoBinOper(), DeepCopyVisitor::visitGeoBinOper(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoBinOper().

2731 { return args0_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:2738

+ Here is the caller graph for this function:

const std::vector<std::shared_ptr<Analyzer::Expr> >& Analyzer::GeoBinOper::getArgs1 ( ) const
inline

Definition at line 2732 of file Analyzer.h.

References args1_.

Referenced by CodeGenerator::codegenGeoBinOper(), DeepCopyVisitor::visitGeoBinOper(), and ScalarExprVisitor< std::unordered_set< InputColDescriptor > >::visitGeoBinOper().

2732 { return args1_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:2739

+ Here is the caller graph for this function:

Geospatial::GeoBase::GeoOp Analyzer::GeoBinOper::getOp ( ) const
inline

Definition at line 2728 of file Analyzer.h.

References op_.

Referenced by CodeGenerator::codegenGeoBinOper(), and DeepCopyVisitor::visitGeoBinOper().

2728 { return op_; }
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:2735

+ Here is the caller graph for this function:

const SQLTypeInfo Analyzer::GeoBinOper::getTypeInfo0 ( ) const
inline

Definition at line 2729 of file Analyzer.h.

References ti0_.

Referenced by CodeGenerator::codegenGeoBinOper(), and DeepCopyVisitor::visitGeoBinOper().

2729 { return ti0_; }
SQLTypeInfo ti0_
Definition: Analyzer.h:2736

+ Here is the caller graph for this function:

const SQLTypeInfo Analyzer::GeoBinOper::getTypeInfo1 ( ) const
inline

Definition at line 2730 of file Analyzer.h.

References ti1_.

Referenced by CodeGenerator::codegenGeoBinOper(), and DeepCopyVisitor::visitGeoBinOper().

2730 { return ti1_; }
SQLTypeInfo ti1_
Definition: Analyzer.h:2737

+ Here is the caller graph for this function:

bool Analyzer::GeoBinOper::operator== ( const Expr rhs) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 2585 of file Analyzer.cpp.

References args0_, args1_, expr_list_match(), op_, ti0_, and ti1_.

2585  {
2586  const auto rhs_geo = dynamic_cast<const GeoBinOper*>(&rhs);
2587  if (!rhs_geo) {
2588  return false;
2589  }
2590  if (op_ != rhs_geo->getOp() || ti0_ != rhs_geo->getTypeInfo0() ||
2591  args0_.size() != rhs_geo->getArgs0().size()) {
2592  return false;
2593  }
2594  if (ti1_ != rhs_geo->getTypeInfo1() || args1_.size() != rhs_geo->getArgs1().size()) {
2595  return false;
2596  }
2597  return expr_list_match(args0_, rhs_geo->getArgs0()) ||
2598  expr_list_match(args1_, rhs_geo->getArgs1());
2599 }
GeoBinOper(const Geospatial::GeoBase::GeoOp op, const SQLTypeInfo &ti, const SQLTypeInfo &ti0, const SQLTypeInfo &ti1, const std::vector< std::shared_ptr< Analyzer::Expr >> &args0, const std::vector< std::shared_ptr< Analyzer::Expr >> &args1)
Definition: Analyzer.h:2715
SQLTypeInfo ti0_
Definition: Analyzer.h:2736
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:2738
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:2735
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:2739
bool expr_list_match(const std::vector< std::shared_ptr< Analyzer::Expr >> &lhs, const std::vector< std::shared_ptr< Analyzer::Expr >> &rhs)
Definition: Analyzer.cpp:4312
SQLTypeInfo ti1_
Definition: Analyzer.h:2737

+ Here is the call graph for this function:

std::string Analyzer::GeoBinOper::toString ( ) const
overridevirtual

Implements Analyzer::Expr.

Definition at line 3049 of file Analyzer.cpp.

References args0_, args1_, Geospatial::GeoBase::kBUFFER, Geospatial::GeoBase::kDIFFERENCE, Geospatial::GeoBase::kINTERSECTION, Geospatial::GeoBase::kUNION, op_, and run_benchmark_import::result.

3049  {
3050  std::string fn;
3051  switch (op_) {
3053  fn = "ST_Intersection";
3054  break;
3056  fn = "ST_Difference";
3057  break;
3059  fn = "ST_Union";
3060  break;
3062  fn = "ST_Buffer";
3063  break;
3064  default:
3065  fn = "Geo_UNKNOWN";
3066  break;
3067  }
3068  std::string result = fn + "(";
3069  // TODO: generate wkt
3070  for (const auto& arg : args0_) {
3071  result += " " + arg->toString();
3072  }
3073  for (const auto& arg : args1_) {
3074  result += " " + arg->toString();
3075  }
3076  return result + " ) ";
3077 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:2738
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:2735
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:2739

Member Data Documentation

const std::vector<std::shared_ptr<Analyzer::Expr> > Analyzer::GeoBinOper::args0_
private

Definition at line 2738 of file Analyzer.h.

Referenced by deep_copy(), getArgs0(), operator==(), and toString().

const std::vector<std::shared_ptr<Analyzer::Expr> > Analyzer::GeoBinOper::args1_
private

Definition at line 2739 of file Analyzer.h.

Referenced by deep_copy(), getArgs1(), operator==(), and toString().

const Geospatial::GeoBase::GeoOp Analyzer::GeoBinOper::op_
private

Definition at line 2735 of file Analyzer.h.

Referenced by deep_copy(), getOp(), operator==(), and toString().

SQLTypeInfo Analyzer::GeoBinOper::ti0_
private

Definition at line 2736 of file Analyzer.h.

Referenced by deep_copy(), getTypeInfo0(), and operator==().

SQLTypeInfo Analyzer::GeoBinOper::ti1_
private

Definition at line 2737 of file Analyzer.h.

Referenced by deep_copy(), getTypeInfo1(), and operator==().


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