OmniSciDB  c1a53651b2
 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_overlaps_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 250 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().

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

References left_operand, and right_operand.

1512  {
1513  left_operand->check_group_by(groupby);
1514  right_operand->check_group_by(groupby);
1515 }
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 483 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().

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

+ 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 435 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().

436  {
437  SQLTypeInfo common_type;
439  shared::StringDictKey dict_key;
440  CHECK(type1.is_string() && type2.is_string());
441  // if type1 and type2 have the same DICT encoding then keep it
442  // otherwise, they must be decompressed
443  if (type1.get_compression() == kENCODING_DICT &&
444  type2.get_compression() == kENCODING_DICT) {
445  if (has_same_dict(type1, type2)) {
446  comp = kENCODING_DICT;
447  if (type1.getStringDictKey().dict_id < type2.getStringDictKey().dict_id) {
448  dict_key = type1.getStringDictKey();
449  } else {
450  dict_key = type2.getStringDictKey();
451  }
452  }
453  } else if (type1.get_compression() == kENCODING_DICT &&
454  type2.get_compression() == kENCODING_NONE) {
455  dict_key = type1.getStringDictKey();
456  } else if (type1.get_compression() == kENCODING_NONE &&
457  type2.get_compression() == kENCODING_DICT) {
458  dict_key = type2.getStringDictKey();
459  } else {
460  dict_key.dict_id =
461  std::max(type1.get_comp_param(),
462  type2.get_comp_param()); // preserve previous comp_param if set
463  }
464  const bool notnull = type1.get_notnull() && type2.get_notnull();
465  if (type1.get_type() == kTEXT || type2.get_type() == kTEXT) {
466  common_type = SQLTypeInfo(kTEXT, 0, 0, notnull, comp, dict_key.dict_id, kNULLT);
467  } else {
468  common_type = SQLTypeInfo(kVARCHAR,
469  std::max(type1.get_dimension(), type2.get_dimension()),
470  0,
471  notnull,
472  comp,
473  dict_key.dict_id,
474  kNULLT);
475  }
476 
477  if (common_type.is_dict_encoded_string()) {
478  common_type.setStringDictKey(dict_key);
479  }
480  return common_type;
481 }
bool has_same_dict(const SQLTypeInfo &type1, const SQLTypeInfo &type2)
Definition: Analyzer.cpp:426
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:381
EncodingType
Definition: sqltypes.h:230
Definition: sqltypes.h:69
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:389
void setStringDictKey(const shared::StringDictKey &dict_key)
Definition: sqltypes.h:1027
HOST DEVICE int get_dimension() const
Definition: sqltypes.h:383
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:392
#define CHECK(condition)
Definition: Logger.h:291
bool is_dict_encoded_string() const
Definition: sqltypes.h:632
bool is_string() const
Definition: sqltypes.h:580
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:388
const shared::StringDictKey & getStringDictKey() const
Definition: sqltypes.h:1021

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

References Analyzer::Expr::add_unique(), anonymous_namespace{Utm.h}::f, left_operand, and right_operand.

3127  {
3128  if (f(this)) {
3129  add_unique(expr_list);
3130  return;
3131  }
3132  left_operand->find_expr(f, expr_list);
3133  right_operand->find_expr(f, expr_list);
3134 }
virtual void add_unique(std::list< const Expr * > &expr_list) const
Definition: Analyzer.cpp:3116
std::shared_ptr< Analyzer::Expr > right_operand
Definition: Analyzer.h:530
constexpr double f
Definition: Utm.h:31
std::shared_ptr< Analyzer::Expr > left_operand
Definition: Analyzer.h:529

+ 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(), anonymous_namespace{RelAlgExecutor.cpp}::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 anonymous_namespace{RelAlgExecutor.cpp}::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 1615 of file Analyzer.cpp.

References kAND, left_operand, optype, and right_operand.

1617  {
1618  if (optype == kAND) {
1619  left_operand->group_predicates(scan_predicates, join_predicates, const_predicates);
1620  right_operand->group_predicates(scan_predicates, join_predicates, const_predicates);
1621  return;
1622  }
1623  std::set<int> rte_idx_set;
1624  left_operand->collect_rte_idx(rte_idx_set);
1625  right_operand->collect_rte_idx(rte_idx_set);
1626  if (rte_idx_set.size() > 1) {
1627  join_predicates.push_back(this);
1628  } else if (rte_idx_set.size() == 1) {
1629  scan_predicates.push_back(this);
1630  } else {
1631  const_predicates.push_back(this);
1632  }
1633 }
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_overlaps_oper ( ) const
inline

Definition at line 453 of file Analyzer.h.

References kOVERLAPS, and optype.

Referenced by HashJoin::normalizeColumnPairs().

453 { return optype == kOVERLAPS; }

+ 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 1550 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.

1550  {
1551  rte_idx = -1;
1552  if (!IS_COMPARISON(optype) || qualifier != kONE) {
1553  return nullptr;
1554  }
1555  if (expr_is<UOper>(left_operand)) {
1557  auto uo = std::dynamic_pointer_cast<UOper>(left_operand);
1558  auto cv = std::dynamic_pointer_cast<ColumnVar>(uo->get_own_operand());
1559  rte_idx = cv->get_rte_idx();
1560  return this->deep_copy();
1561  }
1562  } else if (expr_is<UOper>(right_operand)) {
1564  auto uo = std::dynamic_pointer_cast<UOper>(right_operand);
1565  auto cv = std::dynamic_pointer_cast<ColumnVar>(uo->get_own_operand());
1566  rte_idx = cv->get_rte_idx();
1567  return makeExpr<BinOper>(type_info,
1568  contains_agg,
1570  qualifier,
1571  right_operand->deep_copy(),
1572  left_operand->deep_copy());
1573  }
1574  } else if (expr_is<ColumnVar>(left_operand) && !expr_is<Var>(left_operand) &&
1575  expr_is<Constant>(right_operand)) {
1576  auto cv = std::dynamic_pointer_cast<ColumnVar>(left_operand);
1577  rte_idx = cv->get_rte_idx();
1578  return this->deep_copy();
1579  } else if (expr_is<Constant>(left_operand) && expr_is<ColumnVar>(right_operand) &&
1580  !expr_is<Var>(right_operand)) {
1581  auto cv = std::dynamic_pointer_cast<ColumnVar>(right_operand);
1582  rte_idx = cv->get_rte_idx();
1583  return makeExpr<BinOper>(type_info,
1584  contains_agg,
1586  qualifier,
1587  right_operand->deep_copy(),
1588  left_operand->deep_copy());
1589  }
1590  return nullptr;
1591 }
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:1526
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 2300 of file Analyzer.cpp.

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

2300  {
2301  if (typeid(rhs) != typeid(BinOper)) {
2302  return false;
2303  }
2304  const BinOper& rhs_bo = dynamic_cast<const BinOper&>(rhs);
2305  return optype == rhs_bo.get_optype() && *left_operand == *rhs_bo.get_left_operand() &&
2306  *right_operand == *rhs_bo.get_right_operand();
2307 }
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 1526 of file Analyzer.cpp.

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

Referenced by normalize_simple_predicate().

1528  {
1529  if (expr_is<UOper>(cast_operand) && expr_is<Constant>(const_operand)) {
1530  auto u_expr = std::dynamic_pointer_cast<UOper>(cast_operand);
1531  if (u_expr->get_optype() != kCAST) {
1532  return false;
1533  }
1534  if (!(expr_is<Analyzer::ColumnVar>(u_expr->get_own_operand()) &&
1535  !expr_is<Analyzer::Var>(u_expr->get_own_operand()))) {
1536  return false;
1537  }
1538  const auto& ti = u_expr->get_type_info();
1539  if (ti.is_time() && u_expr->get_operand()->get_type_info().is_time()) {
1540  // Allow casts between time types to pass through
1541  return true;
1542  } else if (ti.is_integer() && u_expr->get_operand()->get_type_info().is_integer()) {
1543  // Allow casts between integer types to pass through
1544  return true;
1545  }
1546  }
1547  return false;
1548 }
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 2683 of file Analyzer.cpp.

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

Referenced by CodeGenerator::getArithWithOverflowIntrinsic().

2683  {
2684  std::string op;
2685  switch (optype) {
2686  case kEQ:
2687  op = "= ";
2688  break;
2689  case kNE:
2690  op = "<> ";
2691  break;
2692  case kLT:
2693  op = "< ";
2694  break;
2695  case kLE:
2696  op = "<= ";
2697  break;
2698  case kGT:
2699  op = "> ";
2700  break;
2701  case kGE:
2702  op = ">= ";
2703  break;
2704  case kAND:
2705  op = "AND ";
2706  break;
2707  case kOR:
2708  op = "OR ";
2709  break;
2710  case kMINUS:
2711  op = "- ";
2712  break;
2713  case kPLUS:
2714  op = "+ ";
2715  break;
2716  case kMULTIPLY:
2717  op = "* ";
2718  break;
2719  case kDIVIDE:
2720  op = "/ ";
2721  break;
2722  case kMODULO:
2723  op = "% ";
2724  break;
2725  case kARRAY_AT:
2726  op = "[] ";
2727  break;
2728  case kOVERLAPS:
2729  op = "OVERLAPS ";
2730  break;
2731  default:
2732  break;
2733  }
2734  std::string str{"("};
2735  str += op;
2736  if (qualifier == kANY) {
2737  str += "ANY ";
2738  } else if (qualifier == kALL) {
2739  str += "ALL ";
2740  }
2741  str += left_operand->toString();
2742  str += right_operand->toString();
2743  str += ") ";
2744  return str;
2745 }
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: