61 #define IS_COMPARISON(X) \
62 ((X) == kEQ || (X) == kBW_EQ || (X) == kBBOX_INTERSECT || (X) == kNE || (X) == kLT || \
63 (X) == kGT || (X) == kLE || (X) == kGE)
64 #define IS_LOGIC(X) ((X) == kAND || (X) == kOR)
65 #define IS_ARITHMETIC(X) \
66 ((X) == kMINUS || (X) == kPLUS || (X) == kMULTIPLY || (X) == kDIVIDE || (X) == kMODULO)
67 #define COMMUTE_COMPARISON(X) \
68 ((X) == kLT ? kGT : (X) == kLE ? kGE : (X) == kGT ? kLT : (X) == kGE ? kLE : (X))
70 ((X) == kNOT || (X) == kUMINUS || (X) == kISNULL || (X) == kEXISTS || (X) == kCAST || \
72 #define IS_EQUIVALENCE(X) ((X) == kEQ || (X) == kBW_EQ || (X) == kBBOX_INTERSECT)
162 constexpr
char const* strings[]{
"MIN",
178 "FIRST_VALUE_IN_FRAME",
180 "LAST_VALUE_IN_FRAME",
182 "NTH_VALUE_IN_FRAME",
188 "CONDITIONAL_CHANGE_EVENT",
190 constexpr
size_t nstrings = ((
sizeof strings) / (
sizeof *strings));
191 constexpr
size_t max_str_idx = nstrings - 1;
193 return strings[size_t(kind)];
212 constexpr
char const* strings[]{
"UNBOUNDED_PRECEDING",
216 "UNBOUNDED_FOLLOWING",
218 constexpr
size_t nstrings = ((
sizeof strings) / (
sizeof *strings));
219 constexpr
size_t max_str_idx = nstrings - 1;
221 return strings[size_t(kind)];
248 #if !(defined(__CUDACC__) || defined(NO_BOOST))
265 return "WINDOW_FUNCTION";
267 return "WINDOW_FUNCTION_FRAMING";
282 LOG(
FATAL) <<
"Invalid SQLQualifier: " << qualifier;
299 return "APPROX_COUNT_DISTINCT";
301 return "APPROX_PERCENTILE";
305 return "SINGLE_VALUE";
315 UNREACHABLE() <<
"Invalid aggregate kind: " << kind;
382 return "BOUNDING_BOX_INTERSECT";
384 return "ENCODE_TEXT";
388 LOG(
FATAL) <<
"Invalid operation kind: " << op;
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";
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";
453 return os <<
"INVALID";
455 LOG(
FATAL) <<
"Invalid string operation";
457 return os <<
"INVALID";
461 if (func_name ==
"LOWER") {
464 if (func_name ==
"UPPER") {
467 if (func_name ==
"INITCAP") {
470 if (func_name ==
"REVERSE") {
473 if (func_name ==
"REPEAT") {
476 if (func_name ==
"||") {
479 if (func_name ==
"LPAD") {
482 if (func_name ==
"RPAD") {
485 if (func_name ==
"TRIM") {
488 if (func_name ==
"LTRIM") {
491 if (func_name ==
"RTRIM") {
494 if (func_name ==
"SUBSTRING") {
497 if (func_name ==
"OVERLAY") {
500 if (func_name ==
"REPLACE") {
503 if (func_name ==
"SPLIT_PART") {
506 if (func_name ==
"REGEXP_REPLACE") {
509 if (func_name ==
"REGEXP_SUBSTR") {
512 if (func_name ==
"REGEXP_MATCH") {
515 if (func_name ==
"REGEXP_COUNT") {
518 if (func_name ==
"JSON_VALUE") {
521 if (func_name ==
"BASE64_ENCODE") {
524 if (func_name ==
"BASE64_DECODE") {
527 if (func_name ==
"URL_ENCODE") {
530 if (func_name ==
"URL_DECODE") {
533 if (func_name ==
"TRY_CAST") {
536 if (func_name ==
"POSITION") {
539 if (func_name ==
"JAROWINKLER_SIMILARITY") {
542 if (func_name ==
"LEVENSHTEIN_DISTANCE") {
545 if (func_name ==
"HASH") {
548 LOG(
FATAL) <<
"Invalid string function " << func_name <<
".";
566 #endif // #if !(defined(__CUDACC__) || defined(NO_BOOST))
SqlStringOpKind name_to_string_op_kind(const std::string &func_name)
std::ostream & operator<<(std::ostream &os, const SessionInfo &session_info)
std::string toString(const Executor::ExtModuleKinds &kind)
bool string_op_returns_string(const SqlStringOpKind kind)
SQLAgg get_non_conditional_agg_type(SQLAgg const agg_type)