OmniSciDB  2e3a973ef4
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::Expradd_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::Exprnormalize_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 std::shared_ptr< Analyzer::Exprrewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const
 
virtual std::shared_ptr< Analyzer::Exprrewrite_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 (bool(*f)(const Expr *), 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 1534 of file Analyzer.h.

Constructor & Destructor Documentation

◆ GeoBinOper()

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

References operator==(), and toString().

1542  : Expr(ti), op_(op), ti0_(ti0), ti1_(ti1), args0_(args0), args1_(args1){};
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:69
SQLTypeInfo ti0_
Definition: Analyzer.h:1557
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:1559
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:1556
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:1560
SQLTypeInfo ti1_
Definition: Analyzer.h:1558
+ Here is the call graph for this function:

Member Function Documentation

◆ deep_copy()

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

Implements Analyzer::Expr.

Definition at line 219 of file Analyzer.cpp.

References Analyzer::Expr::type_info.

219  {
220  return makeExpr<GeoBinOper>(op_, type_info, ti0_, ti1_, args0_, args1_);
221 }
SQLTypeInfo ti0_
Definition: Analyzer.h:1557
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:1559
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:1556
SQLTypeInfo type_info
Definition: Analyzer.h:176
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:1560
SQLTypeInfo ti1_
Definition: Analyzer.h:1558

◆ getArgs0()

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

Definition at line 1552 of file Analyzer.h.

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

1552 { return args0_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:1559
+ Here is the caller graph for this function:

◆ getArgs1()

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

Definition at line 1553 of file Analyzer.h.

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

1553 { return args1_; }
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:1560
+ Here is the caller graph for this function:

◆ getOp()

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

Definition at line 1549 of file Analyzer.h.

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

1549 { return op_; }
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:1556
+ Here is the caller graph for this function:

◆ getTypeInfo0()

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

Definition at line 1550 of file Analyzer.h.

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

1550 { return ti0_; }
SQLTypeInfo ti0_
Definition: Analyzer.h:1557
+ Here is the caller graph for this function:

◆ getTypeInfo1()

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

Definition at line 1551 of file Analyzer.h.

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

1551 { return ti1_; }
SQLTypeInfo ti1_
Definition: Analyzer.h:1558
+ Here is the caller graph for this function:

◆ operator==()

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

Implements Analyzer::Expr.

Definition at line 2387 of file Analyzer.cpp.

References expr_list_match().

2387  {
2388  const auto rhs_geo = dynamic_cast<const GeoBinOper*>(&rhs);
2389  if (!rhs_geo) {
2390  return false;
2391  }
2392  if (op_ != rhs_geo->getOp() || ti0_ != rhs_geo->getTypeInfo0() ||
2393  args0_.size() != rhs_geo->getArgs0().size()) {
2394  return false;
2395  }
2396  if (ti1_ != rhs_geo->getTypeInfo1() || args1_.size() != rhs_geo->getArgs1().size()) {
2397  return false;
2398  }
2399  return expr_list_match(args0_, rhs_geo->getArgs0()) ||
2400  expr_list_match(args1_, rhs_geo->getArgs1());
2401 }
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:1536
SQLTypeInfo ti0_
Definition: Analyzer.h:1557
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:1559
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:1556
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:1560
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:3228
SQLTypeInfo ti1_
Definition: Analyzer.h:1558
+ Here is the call graph for this function:

◆ toString()

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

Implements Analyzer::Expr.

Definition at line 2763 of file Analyzer.cpp.

References Analyzer::InIntegerSet::arg, Geospatial::GeoBase::kBUFFER, Geospatial::GeoBase::kDIFFERENCE, Geospatial::GeoBase::kINTERSECTION, Geospatial::GeoBase::kUNION, and run_benchmark_import::result.

2763  {
2764  std::string fn;
2765  switch (op_) {
2767  fn = "ST_Intersection";
2768  break;
2770  fn = "ST_Difference";
2771  break;
2773  fn = "ST_Union";
2774  break;
2776  fn = "ST_Buffer";
2777  break;
2778  default:
2779  fn = "Geo_UNKNOWN";
2780  break;
2781  }
2782  std::string result = fn + "(";
2783  // TODO: generate wkt
2784  for (const auto& arg : args0_) {
2785  result += " " + arg->toString();
2786  }
2787  for (const auto& arg : args1_) {
2788  result += " " + arg->toString();
2789  }
2790  return result + " ) ";
2791 }
const std::vector< std::shared_ptr< Analyzer::Expr > > args0_
Definition: Analyzer.h:1559
const Geospatial::GeoBase::GeoOp op_
Definition: Analyzer.h:1556
const std::vector< std::shared_ptr< Analyzer::Expr > > args1_
Definition: Analyzer.h:1560

Member Data Documentation

◆ args0_

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

Definition at line 1559 of file Analyzer.h.

◆ args1_

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

Definition at line 1560 of file Analyzer.h.

◆ op_

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

Definition at line 1556 of file Analyzer.h.

◆ ti0_

SQLTypeInfo Analyzer::GeoBinOper::ti0_
private

Definition at line 1557 of file Analyzer.h.

◆ ti1_

SQLTypeInfo Analyzer::GeoBinOper::ti1_
private

Definition at line 1558 of file Analyzer.h.


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