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

Common Enum definitions for SQL processing. More...

#include <cstdio>
#include <ostream>
#include <sstream>
#include <string>
#include "Logger/Logger.h"
+ Include dependency graph for sqldefs.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IS_COMPARISON(X)
 
#define IS_LOGIC(X)   ((X) == kAND || (X) == kOR)
 
#define IS_ARITHMETIC(X)   ((X) == kMINUS || (X) == kPLUS || (X) == kMULTIPLY || (X) == kDIVIDE || (X) == kMODULO)
 
#define COMMUTE_COMPARISON(X)   ((X) == kLT ? kGT : (X) == kLE ? kGE : (X) == kGT ? kLT : (X) == kGE ? kLE : (X))
 
#define IS_UNARY(X)
 
#define IS_EQUIVALENCE(X)   ((X) == kEQ || (X) == kBW_EQ || (X) == kBBOX_INTERSECT)
 

Enumerations

enum  SQLOps {
  kEQ = 0, kBW_EQ, kNE, kLT,
  kGT, kLE, kGE, kAND,
  kOR, kNOT, kMINUS, kPLUS,
  kMULTIPLY, kDIVIDE, kMODULO, kUMINUS,
  kISNULL, kISNOTNULL, kEXISTS, kCAST,
  kARRAY_AT, kUNNEST, kFUNCTION, kIN,
  kBBOX_INTERSECT, kENCODE_TEXT, kINVALID_OP
}
 
enum  SQLQualifier { kONE, kANY, kALL }
 
enum  SQLAgg {
  kAVG, kMIN, kMAX, kSUM,
  kCOUNT, kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, kSAMPLE,
  kSINGLE_VALUE, kMODE, kCOUNT_IF, kSUM_IF,
  kINVALID_AGG
}
 
enum  SqlStringOpKind {
  SqlStringOpKind::LOWER = 1, SqlStringOpKind::UPPER, SqlStringOpKind::INITCAP, SqlStringOpKind::REVERSE,
  SqlStringOpKind::REPEAT, SqlStringOpKind::CONCAT, SqlStringOpKind::RCONCAT, SqlStringOpKind::LPAD,
  SqlStringOpKind::RPAD, SqlStringOpKind::TRIM, SqlStringOpKind::LTRIM, SqlStringOpKind::RTRIM,
  SqlStringOpKind::SUBSTRING, SqlStringOpKind::OVERLAY, SqlStringOpKind::REPLACE, SqlStringOpKind::SPLIT_PART,
  SqlStringOpKind::REGEXP_REPLACE, SqlStringOpKind::REGEXP_SUBSTR, SqlStringOpKind::REGEXP_COUNT, SqlStringOpKind::JSON_VALUE,
  SqlStringOpKind::BASE64_ENCODE, SqlStringOpKind::BASE64_DECODE, SqlStringOpKind::URL_ENCODE, SqlStringOpKind::URL_DECODE,
  SqlStringOpKind::TRY_STRING_CAST, SqlStringOpKind::POSITION, SqlStringOpKind::JAROWINKLER_SIMILARITY, SqlStringOpKind::LEVENSHTEIN_DISTANCE,
  SqlStringOpKind::HASH, SqlStringOpKind::INVALID
}
 
enum  SqlWindowFunctionKind {
  SqlWindowFunctionKind::MIN = 0, SqlWindowFunctionKind::MAX, SqlWindowFunctionKind::AVG, SqlWindowFunctionKind::SUM,
  SqlWindowFunctionKind::COUNT, SqlWindowFunctionKind::ROW_NUMBER, SqlWindowFunctionKind::RANK, SqlWindowFunctionKind::DENSE_RANK,
  SqlWindowFunctionKind::PERCENT_RANK, SqlWindowFunctionKind::CUME_DIST, SqlWindowFunctionKind::NTILE, SqlWindowFunctionKind::LAG,
  SqlWindowFunctionKind::LAG_IN_FRAME, SqlWindowFunctionKind::LEAD, SqlWindowFunctionKind::LEAD_IN_FRAME, SqlWindowFunctionKind::FIRST_VALUE,
  SqlWindowFunctionKind::FIRST_VALUE_IN_FRAME, SqlWindowFunctionKind::LAST_VALUE, SqlWindowFunctionKind::LAST_VALUE_IN_FRAME, SqlWindowFunctionKind::NTH_VALUE,
  SqlWindowFunctionKind::NTH_VALUE_IN_FRAME, SqlWindowFunctionKind::FORWARD_FILL, SqlWindowFunctionKind::BACKWARD_FILL, SqlWindowFunctionKind::COUNT_IF,
  SqlWindowFunctionKind::SUM_IF, SqlWindowFunctionKind::SUM_INTERNAL, SqlWindowFunctionKind::CONDITIONAL_CHANGE_EVENT, SqlWindowFunctionKind::UNKNOWN
}
 
enum  SqlWindowFrameBoundType {
  SqlWindowFrameBoundType::UNBOUNDED_PRECEDING = 0, SqlWindowFrameBoundType::EXPR_PRECEDING, SqlWindowFrameBoundType::CURRENT_ROW, SqlWindowFrameBoundType::EXPR_FOLLOWING,
  SqlWindowFrameBoundType::UNBOUNDED_FOLLOWING, SqlWindowFrameBoundType::UNKNOWN
}
 
enum  SQLStmtType {
  kSELECT, kUPDATE, kINSERT, kDELETE,
  kCREATE_TABLE
}
 
enum  StorageOption { StorageOption::kDISK = 0, StorageOption::kGPU = 1, StorageOption::kCPU = 2 }
 
enum  ViewRefreshOption { kMANUAL = 0, kAUTO = 1, kIMMEDIATE = 2 }
 
enum  JoinType {
  JoinType::INNER, JoinType::LEFT, JoinType::SEMI, JoinType::ANTI,
  JoinType::WINDOW_FUNCTION, JoinType::WINDOW_FUNCTION_FRAMING, JoinType::INVALID
}
 

Functions

constexpr char const * toString (SqlWindowFunctionKind const kind)
 
std::ostream & operator<< (std::ostream &os, SqlWindowFunctionKind const kind)
 
constexpr char const * toString (SqlWindowFrameBoundType const kind)
 
std::ostream & operator<< (std::ostream &os, SqlWindowFrameBoundType const kind)
 
std::string toString (const JoinType &join_type)
 
std::string toString (const SQLQualifier &qualifier)
 
std::string toString (const SQLAgg &kind)
 
SQLAgg get_non_conditional_agg_type (SQLAgg const agg_type)
 
std::string toString (const SQLOps &op)
 
std::ostream & operator<< (std::ostream &os, const SqlStringOpKind kind)
 
SqlStringOpKind name_to_string_op_kind (const std::string &func_name)
 
bool string_op_returns_string (const SqlStringOpKind kind)
 

Detailed Description

Common Enum definitions for SQL processing.

Definition in file sqldefs.h.

Macro Definition Documentation

#define COMMUTE_COMPARISON (   X)    ((X) == kLT ? kGT : (X) == kLE ? kGE : (X) == kGT ? kLT : (X) == kGE ? kLE : (X))

Definition at line 67 of file sqldefs.h.

Referenced by Analyzer::BinOper::normalize_simple_predicate().

#define IS_ARITHMETIC (   X)    ((X) == kMINUS || (X) == kPLUS || (X) == kMULTIPLY || (X) == kDIVIDE || (X) == kMODULO)
#define IS_UNARY (   X)
Value:

Definition at line 69 of file sqldefs.h.

Enumeration Type Documentation

enum JoinType
strong
Enumerator
INNER 
LEFT 
SEMI 
ANTI 
WINDOW_FUNCTION 
WINDOW_FUNCTION_FRAMING 
INVALID 

Definition at line 238 of file sqldefs.h.

enum SQLAgg
Enumerator
kAVG 
kMIN 
kMAX 
kSUM 
kCOUNT 
kAPPROX_COUNT_DISTINCT 
kAPPROX_QUANTILE 
kSAMPLE 
kSINGLE_VALUE 
kMODE 
kCOUNT_IF 
kSUM_IF 
kINVALID_AGG 

Definition at line 76 of file sqldefs.h.

76  {
77  kAVG,
78  kMIN,
79  kMAX,
80  kSUM,
81  kCOUNT,
84  kSAMPLE,
86  kMODE,
87  kCOUNT_IF,
88  kSUM_IF,
90 };
Definition: sqldefs.h:78
Definition: sqldefs.h:80
Definition: sqldefs.h:81
Definition: sqldefs.h:79
Definition: sqldefs.h:77
Definition: sqldefs.h:86
enum SQLOps
Enumerator
kEQ 
kBW_EQ 
kNE 
kLT 
kGT 
kLE 
kGE 
kAND 
kOR 
kNOT 
kMINUS 
kPLUS 
kMULTIPLY 
kDIVIDE 
kMODULO 
kUMINUS 
kISNULL 
kISNOTNULL 
kEXISTS 
kCAST 
kARRAY_AT 
kUNNEST 
kFUNCTION 
kIN 
kBBOX_INTERSECT 
kENCODE_TEXT 
kINVALID_OP 

Definition at line 31 of file sqldefs.h.

31  {
32  kEQ = 0,
33  kBW_EQ,
34  kNE,
35  kLT,
36  kGT,
37  kLE,
38  kGE,
39  kAND,
40  kOR,
41  kNOT,
42  kMINUS,
43  kPLUS,
44  kMULTIPLY,
45  kDIVIDE,
46  kMODULO,
47  kUMINUS,
48  kISNULL,
49  kISNOTNULL,
50  kEXISTS,
51  kCAST,
52  kARRAY_AT,
53  kUNNEST,
54  kFUNCTION,
55  kIN,
59 };
Definition: sqldefs.h:37
Definition: sqldefs.h:38
Definition: sqldefs.h:40
Definition: sqldefs.h:51
Definition: sqldefs.h:32
Definition: sqldefs.h:43
Definition: sqldefs.h:39
Definition: sqldefs.h:36
Definition: sqldefs.h:42
Definition: sqldefs.h:34
Definition: sqldefs.h:55
Definition: sqldefs.h:33
Definition: sqldefs.h:35
Definition: sqldefs.h:41
Enumerator
kONE 
kANY 
kALL 

Definition at line 74 of file sqldefs.h.

74 { kONE, kANY, kALL };
Definition: sqldefs.h:74
Definition: sqldefs.h:74
Definition: sqldefs.h:74
Enumerator
kSELECT 
kUPDATE 
kINSERT 
kDELETE 
kCREATE_TABLE 

Definition at line 230 of file sqldefs.h.

enum SqlStringOpKind
strong
Enumerator
LOWER 
UPPER 
INITCAP 
REVERSE 
REPEAT 
CONCAT 
RCONCAT 
LPAD 
RPAD 
TRIM 
LTRIM 
RTRIM 
SUBSTRING 
OVERLAY 
REPLACE 
SPLIT_PART 
REGEXP_REPLACE 
REGEXP_SUBSTR 
REGEXP_COUNT 
JSON_VALUE 
BASE64_ENCODE 
BASE64_DECODE 
URL_ENCODE 
URL_DECODE 
TRY_STRING_CAST 
POSITION 
JAROWINKLER_SIMILARITY 
LEVENSHTEIN_DISTANCE 
HASH 
INVALID 

Definition at line 92 of file sqldefs.h.

92  {
93  /* Unary */
94  LOWER = 1,
95  UPPER,
96  INITCAP,
97  REVERSE,
98  /* Binary */
99  REPEAT,
100  CONCAT,
101  RCONCAT,
102  /* Ternary */
103  LPAD,
104  RPAD,
105  TRIM,
106  LTRIM,
107  RTRIM,
108  SUBSTRING,
109  OVERLAY,
110  REPLACE,
111  SPLIT_PART,
112  /* 6 args */
115  REGEXP_COUNT,
116  JSON_VALUE,
119  URL_ENCODE,
120  URL_DECODE,
121  TRY_STRING_CAST, // string-to-numeric
122  POSITION, // string-to-numeric
123  JAROWINKLER_SIMILARITY, // string-to-numeric
124  LEVENSHTEIN_DISTANCE, // string-to-numeric
125  HASH, // string-to-numeric
126  INVALID
127 };
enum SqlWindowFunctionKind
strong
Enumerator
MIN 
MAX 
AVG 
SUM 
COUNT 
ROW_NUMBER 
RANK 
DENSE_RANK 
PERCENT_RANK 
CUME_DIST 
NTILE 
LAG 
LAG_IN_FRAME 
LEAD 
LEAD_IN_FRAME 
FIRST_VALUE 
FIRST_VALUE_IN_FRAME 
LAST_VALUE 
LAST_VALUE_IN_FRAME 
NTH_VALUE 
NTH_VALUE_IN_FRAME 
FORWARD_FILL 
BACKWARD_FILL 
COUNT_IF 
SUM_IF 
SUM_INTERNAL 
CONDITIONAL_CHANGE_EVENT 
UNKNOWN 

Definition at line 129 of file sqldefs.h.

129  {
130  MIN = 0,
131  MAX,
132  AVG,
133  SUM,
134  COUNT,
135  ROW_NUMBER,
136  RANK,
137  DENSE_RANK,
138  PERCENT_RANK,
139  CUME_DIST,
140  NTILE,
141  LAG,
142  LAG_IN_FRAME,
143  LEAD,
145  FIRST_VALUE,
147  LAST_VALUE,
149  NTH_VALUE,
151  FORWARD_FILL,
153  COUNT_IF,
154  SUM_IF,
155  SUM_INTERNAL, // For deserialization from Calcite only. Gets rewritten to a regular
156  // SUM.
158  UNKNOWN,
159 };
enum StorageOption
strong
Enumerator
kDISK 
kGPU 
kCPU 

Definition at line 234 of file sqldefs.h.

Enumerator
kMANUAL 
kAUTO 
kIMMEDIATE 

Definition at line 236 of file sqldefs.h.

236 { kMANUAL = 0, kAUTO = 1, kIMMEDIATE = 2 };
Definition: sqldefs.h:236

Function Documentation

SQLAgg get_non_conditional_agg_type ( SQLAgg const  agg_type)
inline

Definition at line 320 of file sqldefs.h.

References kCOUNT, kCOUNT_IF, kSUM, and kSUM_IF.

Referenced by anonymous_namespace{ResultSetReductionJIT.cpp}::emit_aggregate_one_nullable_value().

320  {
321  switch (agg_type) {
322  case kCOUNT_IF:
323  return kCOUNT;
324  case kSUM_IF:
325  return kSUM;
326  default:
327  return agg_type;
328  }
329 }
Definition: sqldefs.h:80
Definition: sqldefs.h:81

+ Here is the caller graph for this function:

SqlStringOpKind name_to_string_op_kind ( const std::string &  func_name)
inline

Definition at line 460 of file sqldefs.h.

References BASE64_DECODE, BASE64_ENCODE, CONCAT, logger::FATAL, HASH, INITCAP, INVALID, JAROWINKLER_SIMILARITY, JSON_VALUE, LEVENSHTEIN_DISTANCE, LOG, LOWER, LPAD, LTRIM, OVERLAY, POSITION, REGEXP_COUNT, REGEXP_REPLACE, REGEXP_SUBSTR, REPEAT, REPLACE, REVERSE, RPAD, RTRIM, SPLIT_PART, SUBSTRING, TRIM, TRY_STRING_CAST, UPPER, URL_DECODE, and URL_ENCODE.

Referenced by RelAlgTranslator::translateStringOper().

460  {
461  if (func_name == "LOWER") {
462  return SqlStringOpKind::LOWER;
463  }
464  if (func_name == "UPPER") {
465  return SqlStringOpKind::UPPER;
466  }
467  if (func_name == "INITCAP") {
469  }
470  if (func_name == "REVERSE") {
472  }
473  if (func_name == "REPEAT") {
475  }
476  if (func_name == "||") {
478  }
479  if (func_name == "LPAD") {
480  return SqlStringOpKind::LPAD;
481  }
482  if (func_name == "RPAD") {
483  return SqlStringOpKind::RPAD;
484  }
485  if (func_name == "TRIM") {
486  return SqlStringOpKind::TRIM;
487  }
488  if (func_name == "LTRIM") {
489  return SqlStringOpKind::LTRIM;
490  }
491  if (func_name == "RTRIM") {
492  return SqlStringOpKind::RTRIM;
493  }
494  if (func_name == "SUBSTRING") {
496  }
497  if (func_name == "OVERLAY") {
499  }
500  if (func_name == "REPLACE") {
502  }
503  if (func_name == "SPLIT_PART") {
505  }
506  if (func_name == "REGEXP_REPLACE") {
508  }
509  if (func_name == "REGEXP_SUBSTR") {
511  }
512  if (func_name == "REGEXP_MATCH") {
514  }
515  if (func_name == "REGEXP_COUNT") {
517  }
518  if (func_name == "JSON_VALUE") {
520  }
521  if (func_name == "BASE64_ENCODE") {
523  }
524  if (func_name == "BASE64_DECODE") {
526  }
527  if (func_name == "URL_ENCODE") {
529  }
530  if (func_name == "URL_DECODE") {
532  }
533  if (func_name == "TRY_CAST") {
535  }
536  if (func_name == "POSITION") {
538  }
539  if (func_name == "JAROWINKLER_SIMILARITY") {
541  }
542  if (func_name == "LEVENSHTEIN_DISTANCE") {
544  }
545  if (func_name == "HASH") {
546  return SqlStringOpKind::HASH;
547  }
548  LOG(FATAL) << "Invalid string function " << func_name << ".";
550 }
#define LOG(tag)
Definition: Logger.h:285

+ Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  os,
SqlWindowFunctionKind const  kind 
)
inline

Definition at line 197 of file sqldefs.h.

References toString().

197  {
198  return os << toString(kind);
199 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  os,
SqlWindowFrameBoundType const  kind 
)
inline

Definition at line 225 of file sqldefs.h.

References toString().

225  {
226  return os << toString(kind);
227 }
std::string toString(const Executor::ExtModuleKinds &kind)
Definition: Execute.h:1703

+ Here is the call graph for this function:

std::ostream& operator<< ( std::ostream &  os,
const SqlStringOpKind  kind 
)
inline

Definition at line 392 of file sqldefs.h.

References BASE64_DECODE, BASE64_ENCODE, CONCAT, logger::FATAL, HASH, INITCAP, INVALID, JAROWINKLER_SIMILARITY, JSON_VALUE, LEVENSHTEIN_DISTANCE, LOG, LOWER, LPAD, LTRIM, OVERLAY, POSITION, RCONCAT, REGEXP_COUNT, REGEXP_REPLACE, REGEXP_SUBSTR, REPEAT, REPLACE, REVERSE, RPAD, RTRIM, SPLIT_PART, SUBSTRING, TRIM, TRY_STRING_CAST, UPPER, URL_DECODE, and URL_ENCODE.

392  {
393  switch (kind) {
395  return os << "LOWER";
397  return os << "UPPER";
399  return os << "INITCAP";
401  return os << "REVERSE";
403  return os << "REPEAT";
405  return os << "CONCAT";
407  return os << "RCONCAT";
409  return os << "LPAD";
411  return os << "RPAD";
413  return os << "TRIM";
415  return os << "LTRIM";
417  return os << "RTRIM";
419  return os << "SUBSTRING";
421  return os << "OVERLAY";
423  return os << "REPLACE";
425  return os << "SPLIT_PART";
427  return os << "REGEXP_REPLACE";
429  return os << "REGEXP_SUBSTR";
431  return os << "REGEXP_COUNT";
433  return os << "JSON_VALUE";
435  return os << "BASE64_ENCODE";
437  return os << "BASE64_DECODE";
439  return os << "URL_ENCODE";
441  return os << "URL_DECODE";
443  return os << "TRY_STRING_CAST";
445  return os << "POSITION";
447  return os << "JAROWINKLER_SIMILARITY";
449  return os << "LEVENSHTEIN_DISTANCE";
451  return os << "HASH";
453  return os << "INVALID";
454  }
455  LOG(FATAL) << "Invalid string operation";
456  // Make compiler happy
457  return os << "INVALID";
458 }
#define LOG(tag)
Definition: Logger.h:285
bool string_op_returns_string ( const SqlStringOpKind  kind)
inline

Definition at line 552 of file sqldefs.h.

References HASH, JAROWINKLER_SIMILARITY, LEVENSHTEIN_DISTANCE, POSITION, REGEXP_COUNT, and TRY_STRING_CAST.

Referenced by TextEncodingCastCountVisitor::visitStringOper().

+ Here is the caller graph for this function:

constexpr char const* toString ( SqlWindowFunctionKind const  kind)

Definition at line 161 of file sqldefs.h.

References UNKNOWN.

161  {
162  constexpr char const* strings[]{"MIN",
163  "MAX",
164  "AVG",
165  "SUM",
166  "COUNT",
167  "ROW_NUMBER",
168  "RANK",
169  "DENSE_RANK",
170  "PERCENT_RANK",
171  "CUME_DIST",
172  "NTILE",
173  "LAG",
174  "LAG_IN_FRAME",
175  "LEAD",
176  "LEAD_IN_FRAME",
177  "FIRST_VALUE",
178  "FIRST_VALUE_IN_FRAME",
179  "LAST_VALUE",
180  "LAST_VALUE_IN_FRAME",
181  "NTH_VALUE",
182  "NTH_VALUE_IN_FRAME",
183  "FORWARD_FILL",
184  "BACKWARD_FILL",
185  "COUNT_IF",
186  "SUM_IF",
187  "SUM_INTERNAL",
188  "CONDITIONAL_CHANGE_EVENT",
189  "UNKNOWN"};
190  constexpr size_t nstrings = ((sizeof strings) / (sizeof *strings));
191  constexpr size_t max_str_idx = nstrings - 1;
192  static_assert(max_str_idx == size_t(SqlWindowFunctionKind::UNKNOWN));
193  return strings[size_t(kind)];
194 }
constexpr char const* toString ( SqlWindowFrameBoundType const  kind)

Definition at line 211 of file sqldefs.h.

References UNKNOWN.

211  {
212  constexpr char const* strings[]{"UNBOUNDED_PRECEDING",
213  "EXPR_PRECEDING",
214  "CURRENT_ROW",
215  "EXPR_FOLLOWING",
216  "UNBOUNDED_FOLLOWING",
217  "UNKNOWN"};
218  constexpr size_t nstrings = ((sizeof strings) / (sizeof *strings));
219  constexpr size_t max_str_idx = nstrings - 1;
220  static_assert(max_str_idx == size_t(SqlWindowFrameBoundType::UNKNOWN));
221  return strings[size_t(kind)];
222 }
std::string toString ( const JoinType join_type)
inline

Definition at line 254 of file sqldefs.h.

References ANTI, INNER, LEFT, SEMI, WINDOW_FUNCTION, and WINDOW_FUNCTION_FRAMING.

254  {
255  switch (join_type) {
256  case JoinType::INNER:
257  return "INNER";
258  case JoinType::LEFT:
259  return "LEFT";
260  case JoinType::SEMI:
261  return "SEMI";
262  case JoinType::ANTI:
263  return "ANTI";
265  return "WINDOW_FUNCTION";
267  return "WINDOW_FUNCTION_FRAMING";
268  default:
269  return "INVALID";
270  }
271 }
std::string toString ( const SQLQualifier qualifier)
inline

Definition at line 273 of file sqldefs.h.

References logger::FATAL, kALL, kANY, kONE, and LOG.

273  {
274  switch (qualifier) {
275  case kONE:
276  return "ONE";
277  case kANY:
278  return "ANY";
279  case kALL:
280  return "ALL";
281  }
282  LOG(FATAL) << "Invalid SQLQualifier: " << qualifier;
283  return "";
284 }
Definition: sqldefs.h:74
#define LOG(tag)
Definition: Logger.h:285
Definition: sqldefs.h:74
Definition: sqldefs.h:74
std::string toString ( const SQLAgg kind)
inline

Definition at line 286 of file sqldefs.h.

References kAPPROX_COUNT_DISTINCT, kAPPROX_QUANTILE, kAVG, kCOUNT, kCOUNT_IF, kINVALID_AGG, kMAX, kMIN, kMODE, kSAMPLE, kSINGLE_VALUE, kSUM, kSUM_IF, and UNREACHABLE.

286  {
287  switch (kind) {
288  case kAVG:
289  return "AVG";
290  case kMIN:
291  return "MIN";
292  case kMAX:
293  return "MAX";
294  case kSUM:
295  return "SUM";
296  case kCOUNT:
297  return "COUNT";
299  return "APPROX_COUNT_DISTINCT";
300  case kAPPROX_QUANTILE:
301  return "APPROX_PERCENTILE";
302  case kSAMPLE:
303  return "SAMPLE";
304  case kSINGLE_VALUE:
305  return "SINGLE_VALUE";
306  case kMODE:
307  return "MODE";
308  case kCOUNT_IF:
309  return "COUNT_IF";
310  case kSUM_IF:
311  return "SUM_IF";
312  case kINVALID_AGG:
313  return "INVALID";
314  default:
315  UNREACHABLE() << "Invalid aggregate kind: " << kind;
316  return {};
317  }
318 }
#define UNREACHABLE()
Definition: Logger.h:338
Definition: sqldefs.h:78
Definition: sqldefs.h:80
Definition: sqldefs.h:81
Definition: sqldefs.h:79
Definition: sqldefs.h:77
Definition: sqldefs.h:86
std::string toString ( const SQLOps op)
inline

Definition at line 331 of file sqldefs.h.

References logger::FATAL, kAND, kARRAY_AT, kBBOX_INTERSECT, kBW_EQ, kCAST, kDIVIDE, kENCODE_TEXT, kEQ, kEXISTS, kFUNCTION, kGE, kGT, kIN, kINVALID_OP, kISNOTNULL, kISNULL, kLE, kLT, kMINUS, kMODULO, kMULTIPLY, kNE, kNOT, kOR, kPLUS, kUMINUS, kUNNEST, and LOG.

331  {
332  switch (op) {
333  case kEQ:
334  return "EQ";
335  case kBW_EQ:
336  return "BW_EQ";
337  case kNE:
338  return "NE";
339  case kLT:
340  return "LT";
341  case kGT:
342  return "GT";
343  case kLE:
344  return "LE";
345  case kGE:
346  return "GE";
347  case kAND:
348  return "AND";
349  case kOR:
350  return "OR";
351  case kNOT:
352  return "NOT";
353  case kMINUS:
354  return "MINUS";
355  case kPLUS:
356  return "PLUS";
357  case kMULTIPLY:
358  return "MULTIPLY";
359  case kDIVIDE:
360  return "DIVIDE";
361  case kMODULO:
362  return "MODULO";
363  case kUMINUS:
364  return "UMINUS";
365  case kISNULL:
366  return "ISNULL";
367  case kISNOTNULL:
368  return "ISNOTNULL";
369  case kEXISTS:
370  return "EXISTS";
371  case kCAST:
372  return "CAST";
373  case kARRAY_AT:
374  return "ARRAY_AT";
375  case kUNNEST:
376  return "UNNEST";
377  case kFUNCTION:
378  return "FUNCTION";
379  case kIN:
380  return "IN";
381  case kBBOX_INTERSECT:
382  return "BOUNDING_BOX_INTERSECT";
383  case kENCODE_TEXT:
384  return "ENCODE_TEXT";
385  case kINVALID_OP:
386  return "INVALID_OP";
387  }
388  LOG(FATAL) << "Invalid operation kind: " << op;
389  return "";
390 }
#define LOG(tag)
Definition: Logger.h:285
Definition: sqldefs.h:37
Definition: sqldefs.h:38
Definition: sqldefs.h:40
Definition: sqldefs.h:51
Definition: sqldefs.h:32
Definition: sqldefs.h:43
Definition: sqldefs.h:39
Definition: sqldefs.h:36
Definition: sqldefs.h:42
Definition: sqldefs.h:34
Definition: sqldefs.h:55
Definition: sqldefs.h:33
Definition: sqldefs.h:35
Definition: sqldefs.h:41