OmniSciDB  8a228a1076
sqldefs.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 MapD Technologies, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
24 #ifndef SQLDEFS_H
25 #define SQLDEFS_H
26 
27 // must not change the order without keeping the array in OperExpr::to_string
28 // in sync.
29 enum SQLOps {
30  kEQ = 0,
32  kNE,
33  kLT,
34  kGT,
35  kLE,
36  kGE,
38  kOR,
53  kIN,
55 };
56 
57 #define IS_COMPARISON(X) \
58  ((X) == kEQ || (X) == kBW_EQ || (X) == kOVERLAPS || (X) == kNE || (X) == kLT || \
59  (X) == kGT || (X) == kLE || (X) == kGE)
60 #define IS_LOGIC(X) ((X) == kAND || (X) == kOR)
61 #define IS_ARITHMETIC(X) \
62  ((X) == kMINUS || (X) == kPLUS || (X) == kMULTIPLY || (X) == kDIVIDE || (X) == kMODULO)
63 #define COMMUTE_COMPARISON(X) \
64  ((X) == kLT ? kGT : (X) == kLE ? kGE : (X) == kGT ? kLT : (X) == kGE ? kLE : (X))
65 #define IS_UNARY(X) \
66  ((X) == kNOT || (X) == kUMINUS || (X) == kISNULL || (X) == kEXISTS || (X) == kCAST)
67 #define IS_EQUIVALENCE(X) ((X) == kEQ || (X) == kBW_EQ || (X) == kOVERLAPS)
68 
70 
71 enum SQLAgg {
80 };
81 
83  ROW_NUMBER,
84  RANK,
85  DENSE_RANK,
87  CUME_DIST,
88  NTILE,
89  LAG,
90  LEAD,
92  LAST_VALUE,
93  AVG,
94  MIN,
95  MAX,
96  SUM,
97  COUNT,
98  SUM_INTERNAL // For deserialization from Calcite only. Gets rewritten to a regular SUM.
99 };
100 
102 
103 enum StorageOption { kDISK = 0, kGPU = 1, kCPU = 2 };
104 
105 enum ViewRefreshOption { kMANUAL = 0, kAUTO = 1, kIMMEDIATE = 2 };
106 
107 enum class JoinType { INNER, LEFT, INVALID };
108 
109 #endif // SQLDEFS_H
Definition: sqldefs.h:69
SQLAgg
Definition: sqldefs.h:71
ViewRefreshOption
Definition: sqldefs.h:105
Definition: sqldefs.h:103
JoinType
Definition: sqldefs.h:107
SQLQualifier
Definition: sqldefs.h:69
SQLOps
Definition: sqldefs.h:29
Definition: sqldefs.h:35
Definition: sqldefs.h:36
Definition: sqldefs.h:38
Definition: sqldefs.h:49
Definition: sqldefs.h:30
Definition: sqldefs.h:41
Definition: sqldefs.h:73
Definition: sqldefs.h:37
Definition: sqldefs.h:75
Definition: sqldefs.h:69
StorageOption
Definition: sqldefs.h:103
SQLStmtType
Definition: sqldefs.h:101
Definition: sqldefs.h:34
Definition: sqldefs.h:40
Definition: sqldefs.h:69
Definition: sqldefs.h:103
Definition: sqldefs.h:32
Definition: sqldefs.h:76
Definition: sqldefs.h:105
SqlWindowFunctionKind
Definition: sqldefs.h:82
Definition: sqldefs.h:53
Definition: sqldefs.h:31
Definition: sqldefs.h:33
Definition: sqldefs.h:74
Definition: sqldefs.h:72
Definition: sqldefs.h:39
Definition: sqldefs.h:103