OmniSciDB  04ee39c94c
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 
72 
74  ROW_NUMBER,
75  RANK,
76  DENSE_RANK,
78  CUME_DIST,
79  NTILE,
80  LAG,
81  LEAD,
83  LAST_VALUE,
84  AVG,
85  MIN,
86  MAX,
87  SUM,
88  COUNT,
89  SUM_INTERNAL // For deserialization from Calcite only. Gets rewritten to a regular SUM.
90 };
91 
93 
94 enum StorageOption { kDISK = 0, kGPU = 1, kCPU = 2 };
95 
96 enum ViewRefreshOption { kMANUAL = 0, kAUTO = 1, kIMMEDIATE = 2 };
97 
98 enum class JoinType { INNER, LEFT, INVALID };
99 
100 #endif // SQLDEFS_H
Definition: sqldefs.h:69
SQLAgg
Definition: sqldefs.h:71
ViewRefreshOption
Definition: sqldefs.h:96
Definition: sqldefs.h:94
JoinType
Definition: sqldefs.h:98
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:71
Definition: sqldefs.h:37
Definition: sqldefs.h:71
Definition: sqldefs.h:69
StorageOption
Definition: sqldefs.h:94
SQLStmtType
Definition: sqldefs.h:92
Definition: sqldefs.h:34
Definition: sqldefs.h:40
Definition: sqldefs.h:69
Definition: sqldefs.h:94
Definition: sqldefs.h:32
Definition: sqldefs.h:71
Definition: sqldefs.h:96
SqlWindowFunctionKind
Definition: sqldefs.h:73
Definition: sqldefs.h:53
Definition: sqldefs.h:31
Definition: sqldefs.h:33
Definition: sqldefs.h:71
Definition: sqldefs.h:71
Definition: sqldefs.h:39
Definition: sqldefs.h:94