OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Analyzer::BinOper Class Reference

#include <Analyzer.h>

+ Inheritance diagram for Analyzer::BinOper:
+ Collaboration diagram for Analyzer::BinOper:

Public Member Functions

 BinOper (const SQLTypeInfo &ti, bool has_agg, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
 
 BinOper (SQLTypes t, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
 
SQLOps get_optype () const
 
bool is_bbox_intersect_oper () const
 
SQLQualifier get_qualifier () const
 
const Exprget_left_operand () const
 
const Exprget_right_operand () const
 
const std::shared_ptr
< Analyzer::Expr
get_own_left_operand () const
 
const std::shared_ptr
< Analyzer::Expr
get_own_right_operand () const
 
void check_group_by (const std::list< std::shared_ptr< Analyzer::Expr >> &groupby) const override
 
std::shared_ptr< Analyzer::Exprdeep_copy () const override
 
std::shared_ptr< Analyzer::Exprnormalize_simple_predicate (int &rte_idx) const override
 
void group_predicates (std::list< const Expr * > &scan_predicates, std::list< const Expr * > &join_predicates, std::list< const Expr * > &const_predicates) const override
 
void collect_rte_idx (std::set< int > &rte_idx_set) const override
 
void collect_column_var (std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &colvar_set, bool include_agg) const override
 
std::shared_ptr< Analyzer::Exprrewrite_with_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
std::shared_ptr< Analyzer::Exprrewrite_with_child_targetlist (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
std::shared_ptr< Analyzer::Exprrewrite_agg_to_var (const std::vector< std::shared_ptr< TargetEntry >> &tlist) const override
 
bool operator== (const Expr &rhs) const override
 
std::string toString () const override
 
void find_expr (std::function< bool(const Expr *)> f, std::list< const Expr * > &expr_list) const override
 
- 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 size_t get_num_column_vars (const bool include_agg) const
 
virtual void print () const
 
virtual void add_unique (std::list< const Expr * > &expr_list) const
 
std::shared_ptr< Analyzer::Exprdecompress ()
 
virtual void get_domain (DomainSet &domain_set) const
 

Static Public Member Functions

static SQLTypeInfo analyze_type_info (SQLOps op, const SQLTypeInfo &left_type, const SQLTypeInfo &right_type, SQLTypeInfo *new_left_type, SQLTypeInfo *new_right_type)
 
static SQLTypeInfo common_numeric_type (const SQLTypeInfo &type1, const SQLTypeInfo &type2)
 
static SQLTypeInfo common_string_type (const SQLTypeInfo &type1, const SQLTypeInfo &type2)
 
static bool simple_predicate_has_simple_cast (const std::shared_ptr< Analyzer::Expr > cast_operand, const std::shared_ptr< Analyzer::Expr > const_operand)
 

Private Attributes

SQLOps optype
 
SQLQualifier qualifier
 
std::shared_ptr< Analyzer::Exprleft_operand
 
std::shared_ptr< Analyzer::Exprright_operand
 

Additional Inherited Members

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

Detailed Description

Definition at line 433 of file Analyzer.h.

Constructor & Destructor Documentation

Analyzer::BinOper::BinOper ( const SQLTypeInfo ti,
bool  has_agg,
SQLOps  o,
SQLQualifier  q,
std::shared_ptr< Analyzer::Expr l,
std::shared_ptr< Analyzer::Expr r 
)
inline

Definition at line 435 of file Analyzer.h.

441  : Expr(ti, has_agg), optype(o), qualifier(q), left_operand(l), right_operand(r) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
Analyzer::BinOper::BinOper ( SQLTypes  t,
SQLOps  o,
SQLQualifier  q,
std::shared_ptr< Analyzer::Expr l,
std::shared_ptr< Analyzer::Expr r 
)
inline

Definition at line 442 of file Analyzer.h.

447  : Expr(t, l->get_type_info().get_notnull() && r->get_type_info().get_notnull())
448  , optype(o)
449  , qualifier(q)
450  , left_operand(l)
451  , right_operand(r) {}
Expr(SQLTypes t, bool notnull)
Definition: Analyzer.h:70
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529

Member Function Documentation

SQLTypeInfo Analyzer::BinOper::analyze_type_info ( SQLOps  op,
const SQLTypeInfo left_type,
const SQLTypeInfo right_type,
SQLTypeInfo new_left_type,
SQLTypeInfo new_right_type 
)
static

Definition at line 267 of file Analyzer.cpp.

References CHECK, common_numeric_type(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), IS_ARITHMETIC, SQLTypeInfo::is_boolean(), IS_COMPARISON, SQLTypeInfo::is_decimal(), SQLTypeInfo::is_integer(), IS_LOGIC, SQLTypeInfo::is_number(), SQLTypeInfo::is_string(), SQLTypeInfo::is_time(), SQLTypeInfo::is_timeinterval(), kBOOLEAN, kDATE, kMINUS, kMODULO, kMULTIPLY, kPLUS, kTIME, kTIMESTAMP, SQLTypeInfo::set_dimension(), SQLTypeInfo::set_notnull(), and SQLTypeInfo::set_scale().

Referenced by Parser::BetweenExpr::analyze(), and Parser::OperExpr::normalize().

271  {
272  SQLTypeInfo result_type;
273  SQLTypeInfo common_type;
274  *new_left_type = left_type;
275  *new_right_type = right_type;
276  if (IS_LOGIC(op)) {
277  if (left_type.get_type() != kBOOLEAN || right_type.get_type() != kBOOLEAN) {
278  throw std::runtime_error(
279  "non-boolean operands cannot be used in logic operations.");
280  }
281  result_type = SQLTypeInfo(kBOOLEAN, false);
282  } else if (IS_COMPARISON(op)) {
283  if (left_type != right_type) {
284  if (left_type.is_number() && right_type.is_number()) {
285  common_type = common_numeric_type(left_type, right_type);
286  *new_left_type = common_type;
287  new_left_type->set_notnull(left_type.get_notnull());
288  *new_right_type = common_type;
289  new_right_type->set_notnull(right_type.get_notnull());
290  } else if (left_type.is_time() && right_type.is_time()) {
291  switch (left_type.get_type()) {
292  case kTIMESTAMP:
293  switch (right_type.get_type()) {
294  case kTIME:
295  throw std::runtime_error("Cannont compare between TIMESTAMP and TIME.");
296  break;
297  case kDATE:
298  *new_left_type = SQLTypeInfo(left_type.get_type(),
299  left_type.get_dimension(),
300  0,
301  left_type.get_notnull());
302  *new_right_type = *new_left_type;
303  new_right_type->set_notnull(right_type.get_notnull());
304  break;
305  case kTIMESTAMP:
306  *new_left_type = SQLTypeInfo(
307  kTIMESTAMP,
308  std::max(left_type.get_dimension(), right_type.get_dimension()),
309  0,
310  left_type.get_notnull());
311  *new_right_type = SQLTypeInfo(
312  kTIMESTAMP,
313  std::max(left_type.get_dimension(), right_type.get_dimension()),
314  0,
315  right_type.get_notnull());
316  break;
317  default:
318  CHECK(false);
319  }
320  break;
321  case kTIME:
322  switch (right_type.get_type()) {
323  case kTIMESTAMP:
324  throw std::runtime_error("Cannont compare between TIME and TIMESTAMP.");
325  break;
326  case kDATE:
327  throw std::runtime_error("Cannont compare between TIME and DATE.");
328  break;
329  case kTIME:
330  *new_left_type = SQLTypeInfo(
331  kTIME,
332  std::max(left_type.get_dimension(), right_type.get_dimension()),
333  0,
334  left_type.get_notnull());
335  *new_right_type = SQLTypeInfo(
336  kTIME,
337  std::max(left_type.get_dimension(), right_type.get_dimension()),
338  0,
339  right_type.get_notnull());
340  break;
341  default:
342  CHECK(false);
343  }
344  break;
345  case kDATE:
346  switch (right_type.get_type()) {
347  case kTIMESTAMP:
348  *new_left_type = SQLTypeInfo(right_type.get_type(),
349  right_type.get_dimension(),
350  0,
351  left_type.get_notnull());
352  *new_right_type = *new_left_type;
353  new_right_type->set_notnull(right_type.get_notnull());
354  break;
355  case kDATE:
356  *new_left_type = SQLTypeInfo(left_type.get_type(),
357  left_type.get_dimension(),
358  0,
359  left_type.get_notnull());
360  *new_right_type = *new_left_type;
361  new_right_type->set_notnull(right_type.get_notnull());
362  break;
363  case kTIME:
364  throw std::runtime_error("Cannont compare between DATE and TIME.");
365  break;
366  default:
367  CHECK(false);
368  }
369  break;
370  default:
371  CHECK(false);
372  }
373  } else if (left_type.is_string() && right_type.is_time()) {
374  *new_left_type = right_type;
375  new_left_type->set_notnull(left_type.get_notnull());
376  *new_right_type = right_type;
377  } else if (left_type.is_time() && right_type.is_string()) {
378  *new_left_type = left_type;
379  *new_right_type = left_type;
380  new_right_type->set_notnull(right_type.get_notnull());
381  } else if (left_type.is_string() && right_type.is_string()) {
382  *new_left_type = left_type;
383  *new_right_type = right_type;
384  } else if (left_type.is_boolean() && right_type.is_boolean()) {
385  const bool notnull = left_type.get_notnull() && right_type.get_notnull();
386  common_type = SQLTypeInfo(kBOOLEAN, notnull);
387  *new_left_type = common_type;
388  *new_right_type = common_type;
389  } else {
390  throw std::runtime_error("Cannot compare between " + left_type.get_type_name() +
391  " and " + right_type.get_type_name());
392  }
393  }
394  result_type = SQLTypeInfo(kBOOLEAN, false);
395  } else if (op == kMINUS &&
396  (left_type.get_type() == kDATE || left_type.get_type() == kTIMESTAMP) &&
397  right_type.is_timeinterval()) {
398  *new_left_type = left_type;
399  *new_right_type = right_type;
400  result_type = left_type;
401  } else if (IS_ARITHMETIC(op)) {
402  if (!(left_type.is_number() || left_type.is_timeinterval()) ||
403  !(right_type.is_number() || right_type.is_timeinterval())) {
404  throw std::runtime_error("non-numeric operands in arithmetic operations.");
405  }
406  if (op == kMODULO && (!left_type.is_integer() || !right_type.is_integer())) {
407  throw std::runtime_error("non-integer operands in modulo operation.");
408  }
409  common_type = common_numeric_type(left_type, right_type);
410  if (common_type.is_decimal()) {
411  if (op == kMULTIPLY) {
412  // Decimal multiplication requires common_type adjustment:
413  // dimension and scale of the result should be increased.
414  auto new_dimension = left_type.get_dimension() + right_type.get_dimension();
415  // If new dimension is over 20 digits, the result may overflow, or it may not.
416  // Rely on the runtime overflow detection rather than a static check here.
417  if (common_type.get_dimension() < new_dimension) {
418  common_type.set_dimension(new_dimension);
419  }
420  common_type.set_scale(left_type.get_scale() + right_type.get_scale());
421  } else if (op == kPLUS || op == kMINUS) {
422  // Scale should remain the same but dimension could actually go up
423  common_type.set_dimension(common_type.get_dimension() + 1);
424  }
425  }
426  *new_left_type = common_type;
427  new_left_type->set_notnull(left_type.get_notnull());
428  *new_right_type = common_type;
429  new_right_type->set_notnull(right_type.get_notnull());
430  if (op == kMULTIPLY) {
431  new_left_type->set_scale(left_type.get_scale());
432  new_right_type->set_scale(right_type.get_scale());
433  }
434  result_type = common_type;
435  } else {
436  throw std::runtime_error("invalid binary operator type.");
437  }
438  result_type.set_notnull(left_type.get_notnull() && right_type.get_notnull());
439  return result_type;
440 }
#define IS_LOGIC(X)
Definition: sqldefs.h:61
Definition: sqltypes.h:76
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
Definition: sqldefs.h:40
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
bool is_number() const
Definition: sqltypes.h:574
bool is_time() const
Definition: sqltypes.h:577
bool is_integer() const
Definition: sqltypes.h:565
void set_scale(int s)
Definition: sqltypes.h:473
bool is_timeinterval() const
Definition: sqltypes.h:592
static SQLTypeInfo common_numeric_type(const SQLTypeInfo &type1, const SQLTypeInfo &type2)
Definition: Analyzer.cpp:500
bool is_boolean() const
Definition: sqltypes.h:580
Definition: sqltypes.h:80
Definition: sqldefs.h:39
#define IS_ARITHMETIC(X)
Definition: sqldefs.h:62
void set_dimension(int d)
Definition: sqltypes.h:470
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
std::string get_type_name() const
Definition: sqltypes.h:482
void set_notnull(bool n)
Definition: sqltypes.h:475
#define CHECK(condition)
Definition: Logger.h:291
bool is_string() const
Definition: sqltypes.h:559
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
bool is_decimal() const
Definition: sqltypes.h:568
#define IS_COMPARISON(X)
Definition: sqldefs.h:58

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Analyzer::BinOper::check_group_by ( const std::list< std::shared_ptr< Analyzer::Expr >> &  groupby) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1538 of file Analyzer.cpp.

References left_operand, and right_operand.

1539  {
1540  left_operand->check_group_by(groupby);
1541  right_operand->check_group_by(groupby);
1542 }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
void Analyzer::BinOper::collect_column_var ( std::set< const ColumnVar *, bool(*)(const ColumnVar *, const ColumnVar *)> &  colvar_set,
bool  include_agg 
) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 483 of file Analyzer.h.

References left_operand, and right_operand.

486  {
487  left_operand->collect_column_var(colvar_set, include_agg);
488  right_operand->collect_column_var(colvar_set, include_agg);
489  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
void Analyzer::BinOper::collect_rte_idx ( std::set< int > &  rte_idx_set) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 479 of file Analyzer.h.

References left_operand, and right_operand.

479  {
480  left_operand->collect_rte_idx(rte_idx_set);
481  right_operand->collect_rte_idx(rte_idx_set);
482  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
SQLTypeInfo Analyzer::BinOper::common_numeric_type ( const SQLTypeInfo type1,
const SQLTypeInfo type2 
)
static

Definition at line 500 of file Analyzer.cpp.

References CHECK, SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_scale(), SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), SQLTypeInfo::is_boolean(), SQLTypeInfo::is_number(), SQLTypeInfo::is_timeinterval(), kBIGINT, kDECIMAL, kDOUBLE, kFLOAT, kINT, sql_constants::kMaxRepresentableNumericPrecision, kNUMERIC, kSMALLINT, kTINYINT, and SQLTypeInfo::set_fixed_size().

Referenced by Parser::InValues::analyze(), analyze_type_info(), and Parser::CaseExpr::normalize().

501  {
502  SQLTypeInfo common_type;
503  const bool notnull = type1.get_notnull() && type2.get_notnull();
504  if (type1.get_type() == type2.get_type()) {
505  CHECK(((type1.is_number() || type1.is_timeinterval()) &&
506  (type2.is_number() || type2.is_timeinterval())) ||
507  (type1.is_boolean() && type2.is_boolean()));
508  common_type = SQLTypeInfo(type1.get_type(),
509  std::max(type1.get_dimension(), type2.get_dimension()),
510  std::max(type1.get_scale(), type2.get_scale()),
511  notnull);
512  return common_type;
513  }
514  std::string timeinterval_op_error{
515  "Operator type not supported for time interval arithmetic: "};
516  if (type1.is_timeinterval()) {
517  if (!type2.is_number()) {
518  // allow `number` types to interpret millisecond / microsecond / nanosecond b/c it
519  // may require double and decimal types to represent their time value correctly
520  throw std::runtime_error(timeinterval_op_error + type2.get_type_name());
521  }
522  return type1;
523  }
524  if (type2.is_timeinterval()) {
525  if (!type1.is_number()) {
526  throw std::runtime_error(timeinterval_op_error + type1.get_type_name());
527  }
528  return type2;
529  }
530  CHECK(type1.is_number() && type2.is_number());
531  switch (type1.get_type()) {
532  case kTINYINT:
533  switch (type2.get_type()) {
534  case kSMALLINT:
535  common_type = SQLTypeInfo(kSMALLINT, notnull);
536  break;
537  case kINT:
538  common_type = SQLTypeInfo(kINT, notnull);
539  break;
540  case kBIGINT:
541  common_type = SQLTypeInfo(kBIGINT, notnull);
542  break;
543  case kFLOAT:
544  common_type = SQLTypeInfo(kFLOAT, notnull);
545  break;
546  case kDOUBLE:
547  common_type = SQLTypeInfo(kDOUBLE, notnull);
548  break;
549  case kNUMERIC:
550  case kDECIMAL:
551  common_type =
553  std::max(5 + type2.get_scale(), type2.get_dimension()),
554  type2.get_scale(),
555  notnull);
556  break;
557  default:
558  CHECK(false);
559  }
560  break;
561  case kSMALLINT:
562  switch (type2.get_type()) {
563  case kTINYINT:
564  common_type = SQLTypeInfo(kSMALLINT, notnull);
565  break;
566  case kINT:
567  common_type = SQLTypeInfo(kINT, notnull);
568  break;
569  case kBIGINT:
570  common_type = SQLTypeInfo(kBIGINT, notnull);
571  break;
572  case kFLOAT:
573  common_type = SQLTypeInfo(kFLOAT, notnull);
574  break;
575  case kDOUBLE:
576  common_type = SQLTypeInfo(kDOUBLE, notnull);
577  break;
578  case kNUMERIC:
579  case kDECIMAL:
580  common_type =
582  std::max(5 + type2.get_scale(), type2.get_dimension()),
583  type2.get_scale(),
584  notnull);
585  break;
586  default:
587  CHECK(false);
588  }
589  break;
590  case kINT:
591  switch (type2.get_type()) {
592  case kTINYINT:
593  common_type = SQLTypeInfo(kINT, notnull);
594  break;
595  case kSMALLINT:
596  common_type = SQLTypeInfo(kINT, notnull);
597  break;
598  case kBIGINT:
599  common_type = SQLTypeInfo(kBIGINT, notnull);
600  break;
601  case kFLOAT:
602  common_type = SQLTypeInfo(kFLOAT, notnull);
603  break;
604  case kDOUBLE:
605  common_type = SQLTypeInfo(kDOUBLE, notnull);
606  break;
607  case kNUMERIC:
608  case kDECIMAL:
609  common_type = SQLTypeInfo(
610  kDECIMAL,
612  10 + type2.get_scale()),
613  type2.get_dimension()),
614  type2.get_scale(),
615  notnull);
616  break;
617  default:
618  CHECK(false);
619  }
620  break;
621  case kBIGINT:
622  switch (type2.get_type()) {
623  case kTINYINT:
624  common_type = SQLTypeInfo(kBIGINT, notnull);
625  break;
626  case kSMALLINT:
627  common_type = SQLTypeInfo(kBIGINT, notnull);
628  break;
629  case kINT:
630  common_type = SQLTypeInfo(kBIGINT, notnull);
631  break;
632  case kFLOAT:
633  common_type = SQLTypeInfo(kFLOAT, notnull);
634  break;
635  case kDOUBLE:
636  common_type = SQLTypeInfo(kDOUBLE, notnull);
637  break;
638  case kNUMERIC:
639  case kDECIMAL:
640  common_type = SQLTypeInfo(kDECIMAL,
642  type2.get_scale(),
643  notnull);
644  break;
645  default:
646  CHECK(false);
647  }
648  break;
649  case kFLOAT:
650  switch (type2.get_type()) {
651  case kTINYINT:
652  common_type = SQLTypeInfo(kFLOAT, notnull);
653  break;
654  case kSMALLINT:
655  common_type = SQLTypeInfo(kFLOAT, notnull);
656  break;
657  case kINT:
658  common_type = SQLTypeInfo(kFLOAT, notnull);
659  break;
660  case kBIGINT:
661  common_type = SQLTypeInfo(kFLOAT, notnull);
662  break;
663  case kDOUBLE:
664  common_type = SQLTypeInfo(kDOUBLE, notnull);
665  break;
666  case kNUMERIC:
667  case kDECIMAL:
668  common_type = SQLTypeInfo(kFLOAT, notnull);
669  break;
670  default:
671  CHECK(false);
672  }
673  break;
674  case kDOUBLE:
675  switch (type2.get_type()) {
676  case kTINYINT:
677  case kSMALLINT:
678  case kINT:
679  case kBIGINT:
680  case kFLOAT:
681  case kNUMERIC:
682  case kDECIMAL:
683  common_type = SQLTypeInfo(kDOUBLE, notnull);
684  break;
685  default:
686  CHECK(false);
687  }
688  break;
689  case kNUMERIC:
690  case kDECIMAL:
691  switch (type2.get_type()) {
692  case kTINYINT:
693  common_type =
695  std::max(3 + type1.get_scale(), type1.get_dimension()),
696  type1.get_scale(),
697  notnull);
698  break;
699  case kSMALLINT:
700  common_type =
702  std::max(5 + type1.get_scale(), type1.get_dimension()),
703  type1.get_scale(),
704  notnull);
705  break;
706  case kINT:
707  common_type = SQLTypeInfo(
708  kDECIMAL,
710  10 + type1.get_scale()),
711  type2.get_dimension()),
712  type1.get_scale(),
713  notnull);
714  break;
715  case kBIGINT:
716  common_type = SQLTypeInfo(kDECIMAL,
718  type1.get_scale(),
719  notnull);
720  break;
721  case kFLOAT:
722  common_type = SQLTypeInfo(kFLOAT, notnull);
723  break;
724  case kDOUBLE:
725  common_type = SQLTypeInfo(kDOUBLE, notnull);
726  break;
727  case kNUMERIC:
728  case kDECIMAL: {
729  int common_scale = std::max(type1.get_scale(), type2.get_scale());
730  common_type = SQLTypeInfo(kDECIMAL,
731  std::max(type1.get_dimension() - type1.get_scale(),
732  type2.get_dimension() - type2.get_scale()) +
733  common_scale,
734  common_scale,
735  notnull);
736  break;
737  }
738  default:
739  CHECK(false);
740  }
741  break;
742  default:
743  CHECK(false);
744  }
745  common_type.set_fixed_size();
746  return common_type;
747 }
static constexpr int32_t kMaxRepresentableNumericPrecision
Definition: sqltypes.h:60
HOST DEVICE int get_scale() const
Definition: sqltypes.h:396
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
bool is_number() const
Definition: sqltypes.h:574
bool is_timeinterval() const
Definition: sqltypes.h:592
bool is_boolean() const
Definition: sqltypes.h:580
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
std::string get_type_name() const
Definition: sqltypes.h:482
#define CHECK(condition)
Definition: Logger.h:291
Definition: sqltypes.h:72
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SQLTypeInfo Analyzer::BinOper::common_string_type ( const SQLTypeInfo type1,
const SQLTypeInfo type2 
)
static

Definition at line 452 of file Analyzer.cpp.

References CHECK, shared::StringDictKey::dict_id, SQLTypeInfo::get_comp_param(), SQLTypeInfo::get_compression(), SQLTypeInfo::get_dimension(), SQLTypeInfo::get_notnull(), SQLTypeInfo::get_type(), SQLTypeInfo::getStringDictKey(), Analyzer::anonymous_namespace{Analyzer.cpp}::has_same_dict(), SQLTypeInfo::is_dict_encoded_string(), SQLTypeInfo::is_string(), kENCODING_DICT, kENCODING_NONE, kNULLT, kTEXT, kVARCHAR, and SQLTypeInfo::setStringDictKey().

Referenced by Parser::InValues::analyze().

453  {
454  SQLTypeInfo common_type;
456  shared::StringDictKey dict_key;
457  CHECK(type1.is_string() && type2.is_string());
458  // if type1 and type2 have the same DICT encoding then keep it
459  // otherwise, they must be decompressed
460  if (type1.get_compression() == kENCODING_DICT &&
461  type2.get_compression() == kENCODING_DICT) {
462  if (has_same_dict(type1, type2)) {
463  comp = kENCODING_DICT;
464  if (type1.getStringDictKey().dict_id < type2.getStringDictKey().dict_id) {
465  dict_key = type1.getStringDictKey();
466  } else {
467  dict_key = type2.getStringDictKey();
468  }
469  }
470  } else if (type1.get_compression() == kENCODING_DICT &&
471  type2.get_compression() == kENCODING_NONE) {
472  dict_key = type1.getStringDictKey();
473  } else if (type1.get_compression() == kENCODING_NONE &&
474  type2.get_compression() == kENCODING_DICT) {
475  dict_key = type2.getStringDictKey();
476  } else {
477  dict_key.dict_id =
478  std::max(type1.get_comp_param(),
479  type2.get_comp_param()); // preserve previous comp_param if set
480  }
481  const bool notnull = type1.get_notnull() && type2.get_notnull();
482  if (type1.get_type() == kTEXT || type2.get_type() == kTEXT) {
483  common_type = SQLTypeInfo(kTEXT, 0, 0, notnull, comp, dict_key.dict_id, kNULLT);
484  } else {
485  common_type = SQLTypeInfo(kVARCHAR,
486  std::max(type1.get_dimension(), type2.get_dimension()),
487  0,
488  notnull,
489  comp,
490  dict_key.dict_id,
491  kNULLT);
492  }
493 
494  if (common_type.is_dict_encoded_string()) {
495  common_type.setStringDictKey(dict_key);
496  }
497  return common_type;
498 }
bool has_same_dict(const SQLTypeInfo &type1, const SQLTypeInfo &type2)
Definition: Analyzer.cpp:443
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
EncodingType
Definition: sqltypes.h:240
Definition: sqltypes.h:79
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
void setStringDictKey(const shared::StringDictKey &dict_key)
Definition: sqltypes.h:1061
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:393
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:402
#define CHECK(condition)
Definition: Logger.h:291
bool is_dict_encoded_string() const
Definition: sqltypes.h:641
bool is_string() const
Definition: sqltypes.h:559
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:398
const shared::StringDictKey & getStringDictKey() const
Definition: sqltypes.h:1055

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 106 of file Analyzer.cpp.

References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.

Referenced by normalize_simple_predicate().

106  {
107  return makeExpr<BinOper>(type_info,
108  contains_agg,
109  optype,
110  qualifier,
111  left_operand->deep_copy(),
112  right_operand->deep_copy());
113 }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
bool contains_agg
Definition: Analyzer.h:181

+ Here is the caller graph for this function:

void Analyzer::BinOper::find_expr ( std::function< bool(const Expr *)>  f,
std::list< const Expr * > &  expr_list 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 3255 of file Analyzer.cpp.

References Analyzer::Expr::add_unique(), f(), left_operand, and right_operand.

3256  {
3257  if (f(this)) {
3258  add_unique(expr_list);
3259  return;
3260  }
3261  left_operand->find_expr(f, expr_list);
3262  right_operand->find_expr(f, expr_list);
3263 }
virtual void add_unique(std::list< const Expr * > &expr_list) const
Definition: Analyzer.cpp:3245
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
torch::Tensor f(torch::Tensor x, torch::Tensor W_target, torch::Tensor b_target)

+ Here is the call graph for this function:

const Expr* Analyzer::BinOper::get_left_operand ( ) const
inline

Definition at line 455 of file Analyzer.h.

References left_operand.

Referenced by anonymous_namespace{CompareIR.cpp}::check_array_comp_cond(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenArith(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), anonymous_namespace{PerfectJoinHashTable.cpp}::get_cols(), anonymous_namespace{HashJoin.cpp}::get_cols(), anonymous_namespace{LogicalIR.cpp}::get_likelihood(), anonymous_namespace{LogicalIR.cpp}::get_weight(), getExpressionRange(), CodeGenerator::hashJoinLhsTuple(), RelAlgExecutor::isRowidLookup(), anonymous_namespace{CompareIR.cpp}::lower_multicol_compare(), HashJoin::normalizeColumnPairs(), QueryPlanDagExtractor::normalizeColumnsPair(), operator==(), Executor::skipFragment(), RelAlgTranslator::translateIntervalExprForWindowFraming(), ScalarExprToSql::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), DeepCopyVisitor::visitBinOper(), ScalarExprVisitor< std::set< shared::TableKey > >::visitBinOper(), TextEncodingCastCountVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().

455 { return left_operand.get(); }
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529

+ Here is the caller graph for this function:

const std::shared_ptr<Analyzer::Expr> Analyzer::BinOper::get_own_left_operand ( ) const
inline
const std::shared_ptr<Analyzer::Expr> Analyzer::BinOper::get_own_right_operand ( ) const
inline

Definition at line 460 of file Analyzer.h.

References right_operand.

Referenced by CodeGenerator::codegenCmp(), anonymous_namespace{CompareIR.cpp}::lower_bw_eq(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().

460  {
461  return right_operand;
462  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530

+ Here is the caller graph for this function:

SQLQualifier Analyzer::BinOper::get_qualifier ( ) const
inline

Definition at line 454 of file Analyzer.h.

References qualifier.

Referenced by CodeGenerator::codegenCmp(), anonymous_namespace{LogicalIR.cpp}::is_qualified_bin_oper(), anonymous_namespace{CompareIR.cpp}::lower_bw_eq(), DeepCopyVisitor::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::RecursiveOrToInVisitor::visitBinOper(), and anonymous_namespace{ExpressionRewrite.cpp}::ConstantFoldingVisitor::visitBinOper().

454 { return qualifier; }
SQLQualifier qualifier
Definition: Analyzer.h:527

+ Here is the caller graph for this function:

const Expr* Analyzer::BinOper::get_right_operand ( ) const
inline

Definition at line 456 of file Analyzer.h.

References right_operand.

Referenced by anonymous_namespace{CompareIR.cpp}::check_array_comp_cond(), CodeGenerator::checkExpressionRanges(), CodeGenerator::codegenArith(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenCmp(), CodeGenerator::codegenDeciDiv(), CodeGenerator::codegenFpArith(), CodeGenerator::codegenIntArith(), CodeGenerator::codegenLogical(), CodeGenerator::codegenLogicalShortCircuit(), anonymous_namespace{LogicalIR.cpp}::contains_unsafe_division(), anonymous_namespace{PerfectJoinHashTable.cpp}::get_cols(), anonymous_namespace{HashJoin.cpp}::get_cols(), getExpressionRange(), CodeGenerator::hashJoinLhsTuple(), anonymous_namespace{CompareIR.cpp}::lower_multicol_compare(), anonymous_namespace{WindowExpressionRewrite.cpp}::matches_gt_bigint_zero(), HashJoin::normalizeColumnPairs(), QueryPlanDagExtractor::normalizeColumnsPair(), operator==(), anonymous_namespace{LogicalIR.cpp}::should_defer_eval(), RelAlgTranslator::translateIntervalExprForWindowFraming(), ScalarExprToSql::visitBinOper(), anonymous_namespace{ExpressionRewrite.cpp}::OrToInVisitor::visitBinOper(), DeepCopyVisitor::visitBinOper(), ScalarExprVisitor< std::set< shared::TableKey > >::visitBinOper(), and TextEncodingCastCountVisitor::visitBinOper().

456 { return right_operand.get(); }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530

+ Here is the caller graph for this function:

void Analyzer::BinOper::group_predicates ( std::list< const Expr * > &  scan_predicates,
std::list< const Expr * > &  join_predicates,
std::list< const Expr * > &  const_predicates 
) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1642 of file Analyzer.cpp.

References kAND, left_operand, optype, and right_operand.

1644  {
1645  if (optype == kAND) {
1646  left_operand->group_predicates(scan_predicates, join_predicates, const_predicates);
1647  right_operand->group_predicates(scan_predicates, join_predicates, const_predicates);
1648  return;
1649  }
1650  std::set<int> rte_idx_set;
1651  left_operand->collect_rte_idx(rte_idx_set);
1652  right_operand->collect_rte_idx(rte_idx_set);
1653  if (rte_idx_set.size() > 1) {
1654  join_predicates.push_back(this);
1655  } else if (rte_idx_set.size() == 1) {
1656  scan_predicates.push_back(this);
1657  } else {
1658  const_predicates.push_back(this);
1659  }
1660 }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
Definition: sqldefs.h:36
bool Analyzer::BinOper::is_bbox_intersect_oper ( ) const
inline

Definition at line 453 of file Analyzer.h.

References kBBOX_INTERSECT, and optype.

Referenced by HashJoin::normalizeColumnPairs(), and QueryPlanDagExtractor::normalizeColumnsPair().

453 { return optype == kBBOX_INTERSECT; }

+ Here is the caller graph for this function:

std::shared_ptr< Analyzer::Expr > Analyzer::BinOper::normalize_simple_predicate ( int &  rte_idx) const
overridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 1577 of file Analyzer.cpp.

References COMMUTE_COMPARISON, Analyzer::Expr::contains_agg, deep_copy(), Analyzer::ColumnVar::get_rte_idx(), IS_COMPARISON, kONE, left_operand, optype, qualifier, right_operand, simple_predicate_has_simple_cast(), and Analyzer::Expr::type_info.

1577  {
1578  rte_idx = -1;
1579  if (!IS_COMPARISON(optype) || qualifier != kONE) {
1580  return nullptr;
1581  }
1582  if (expr_is<UOper>(left_operand)) {
1584  auto uo = std::dynamic_pointer_cast<UOper>(left_operand);
1585  auto cv = std::dynamic_pointer_cast<ColumnVar>(uo->get_own_operand());
1586  rte_idx = cv->get_rte_idx();
1587  return this->deep_copy();
1588  }
1589  } else if (expr_is<UOper>(right_operand)) {
1591  auto uo = std::dynamic_pointer_cast<UOper>(right_operand);
1592  auto cv = std::dynamic_pointer_cast<ColumnVar>(uo->get_own_operand());
1593  rte_idx = cv->get_rte_idx();
1594  return makeExpr<BinOper>(type_info,
1595  contains_agg,
1597  qualifier,
1598  right_operand->deep_copy(),
1599  left_operand->deep_copy());
1600  }
1601  } else if (expr_is<ColumnVar>(left_operand) && !expr_is<Var>(left_operand) &&
1602  expr_is<Constant>(right_operand)) {
1603  auto cv = std::dynamic_pointer_cast<ColumnVar>(left_operand);
1604  rte_idx = cv->get_rte_idx();
1605  return this->deep_copy();
1606  } else if (expr_is<Constant>(left_operand) && expr_is<ColumnVar>(right_operand) &&
1607  !expr_is<Var>(right_operand)) {
1608  auto cv = std::dynamic_pointer_cast<ColumnVar>(right_operand);
1609  rte_idx = cv->get_rte_idx();
1610  return makeExpr<BinOper>(type_info,
1611  contains_agg,
1613  qualifier,
1614  right_operand->deep_copy(),
1615  left_operand->deep_copy());
1616  }
1617  return nullptr;
1618 }
static bool simple_predicate_has_simple_cast(const std::shared_ptr< Analyzer::Expr > cast_operand, const std::shared_ptr< Analyzer::Expr > const_operand)
Definition: Analyzer.cpp:1553
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
Definition: sqldefs.h:71
#define COMMUTE_COMPARISON(X)
Definition: sqldefs.h:64
std::shared_ptr< Analyzer::Expr > deep_copy() const override
Definition: Analyzer.cpp:106
bool contains_agg
Definition: Analyzer.h:181
#define IS_COMPARISON(X)
Definition: sqldefs.h:58

+ Here is the call graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2359 of file Analyzer.cpp.

References get_left_operand(), get_optype(), get_right_operand(), left_operand, optype, and right_operand.

2359  {
2360  if (typeid(rhs) != typeid(BinOper)) {
2361  return false;
2362  }
2363  const BinOper& rhs_bo = dynamic_cast<const BinOper&>(rhs);
2364  return optype == rhs_bo.get_optype() && *left_operand == *rhs_bo.get_left_operand() &&
2365  *right_operand == *rhs_bo.get_right_operand();
2366 }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
BinOper(const SQLTypeInfo &ti, bool has_agg, SQLOps o, SQLQualifier q, std::shared_ptr< Analyzer::Expr > l, std::shared_ptr< Analyzer::Expr > r)
Definition: Analyzer.h:435
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529

+ Here is the call graph for this function:

std::shared_ptr<Analyzer::Expr> Analyzer::BinOper::rewrite_agg_to_var ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 508 of file Analyzer.h.

References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.

509  {
510  return makeExpr<BinOper>(type_info,
511  contains_agg,
512  optype,
513  qualifier,
514  left_operand->rewrite_agg_to_var(tlist),
515  right_operand->rewrite_agg_to_var(tlist));
516  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
bool contains_agg
Definition: Analyzer.h:181
std::shared_ptr<Analyzer::Expr> Analyzer::BinOper::rewrite_with_child_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 499 of file Analyzer.h.

References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.

500  {
501  return makeExpr<BinOper>(type_info,
502  contains_agg,
503  optype,
504  qualifier,
505  left_operand->rewrite_with_child_targetlist(tlist),
506  right_operand->rewrite_with_child_targetlist(tlist));
507  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
bool contains_agg
Definition: Analyzer.h:181
std::shared_ptr<Analyzer::Expr> Analyzer::BinOper::rewrite_with_targetlist ( const std::vector< std::shared_ptr< TargetEntry >> &  tlist) const
inlineoverridevirtual

Reimplemented from Analyzer::Expr.

Definition at line 490 of file Analyzer.h.

References Analyzer::Expr::contains_agg, left_operand, optype, qualifier, right_operand, and Analyzer::Expr::type_info.

491  {
492  return makeExpr<BinOper>(type_info,
493  contains_agg,
494  optype,
495  qualifier,
496  left_operand->rewrite_with_targetlist(tlist),
497  right_operand->rewrite_with_targetlist(tlist));
498  }
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
SQLQualifier qualifier
Definition: Analyzer.h:527
SQLTypeInfo type_info
Definition: Analyzer.h:180
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
bool contains_agg
Definition: Analyzer.h:181
bool Analyzer::BinOper::simple_predicate_has_simple_cast ( const std::shared_ptr< Analyzer::Expr cast_operand,
const std::shared_ptr< Analyzer::Expr const_operand 
)
static

Definition at line 1553 of file Analyzer.cpp.

References Analyzer::Expr::get_type_info(), and kCAST.

Referenced by normalize_simple_predicate().

1555  {
1556  if (expr_is<UOper>(cast_operand) && expr_is<Constant>(const_operand)) {
1557  auto u_expr = std::dynamic_pointer_cast<UOper>(cast_operand);
1558  if (u_expr->get_optype() != kCAST) {
1559  return false;
1560  }
1561  if (!(expr_is<Analyzer::ColumnVar>(u_expr->get_own_operand()) &&
1562  !expr_is<Analyzer::Var>(u_expr->get_own_operand()))) {
1563  return false;
1564  }
1565  const auto& ti = u_expr->get_type_info();
1566  if (ti.is_time() && u_expr->get_operand()->get_type_info().is_time()) {
1567  // Allow casts between time types to pass through
1568  return true;
1569  } else if (ti.is_integer() && u_expr->get_operand()->get_type_info().is_integer()) {
1570  // Allow casts between integer types to pass through
1571  return true;
1572  }
1573  }
1574  return false;
1575 }
Definition: sqldefs.h:48

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Implements Analyzer::Expr.

Definition at line 2786 of file Analyzer.cpp.

References kALL, kAND, kANY, kARRAY_AT, kBBOX_INTERSECT, kDIVIDE, kEQ, kGE, kGT, kLE, kLT, kMINUS, kMODULO, kMULTIPLY, kNE, kOR, kPLUS, left_operand, optype, qualifier, and right_operand.

Referenced by CodeGenerator::getArithWithOverflowIntrinsic().

2786  {
2787  std::string op;
2788  switch (optype) {
2789  case kEQ:
2790  op = "= ";
2791  break;
2792  case kNE:
2793  op = "<> ";
2794  break;
2795  case kLT:
2796  op = "< ";
2797  break;
2798  case kLE:
2799  op = "<= ";
2800  break;
2801  case kGT:
2802  op = "> ";
2803  break;
2804  case kGE:
2805  op = ">= ";
2806  break;
2807  case kAND:
2808  op = "AND ";
2809  break;
2810  case kOR:
2811  op = "OR ";
2812  break;
2813  case kMINUS:
2814  op = "- ";
2815  break;
2816  case kPLUS:
2817  op = "+ ";
2818  break;
2819  case kMULTIPLY:
2820  op = "* ";
2821  break;
2822  case kDIVIDE:
2823  op = "/ ";
2824  break;
2825  case kMODULO:
2826  op = "% ";
2827  break;
2828  case kARRAY_AT:
2829  op = "[] ";
2830  break;
2831  case kBBOX_INTERSECT:
2832  op = "BBOX_INTERSECT ";
2833  break;
2834  default:
2835  break;
2836  }
2837  std::string str{"("};
2838  str += op;
2839  if (qualifier == kANY) {
2840  str += "ANY ";
2841  } else if (qualifier == kALL) {
2842  str += "ALL ";
2843  }
2844  str += left_operand->toString();
2845  str += right_operand->toString();
2846  str += ") ";
2847  return str;
2848 }
Definition: sqldefs.h:71
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
Definition: sqldefs.h:34
Definition: sqldefs.h:35
Definition: sqldefs.h:37
Definition: sqldefs.h:29
Definition: sqldefs.h:40
SQLQualifier qualifier
Definition: Analyzer.h:527
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529
Definition: sqldefs.h:36
Definition: sqldefs.h:71
Definition: sqldefs.h:33
Definition: sqldefs.h:39
Definition: sqldefs.h:31
Definition: sqldefs.h:32

+ Here is the caller graph for this function:

Member Data Documentation


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