github.com/insionng/yougam@v0.0.0-20170714101924-2bc18d833463/libraries/pingcap/tipb/proto/expression.proto (about) 1 syntax = "proto2"; 2 3 package tipb; 4 5 option java_multiple_files = true; 6 option java_package = "com.pingcap.tidb.tipb"; 7 8 enum ExprType { 9 /* Children count 0. */ 10 // Values are encoded bytes. 11 Null = 0; 12 Int64 = 1; 13 Uint64 = 2; 14 Float32 = 3; 15 Float64 = 4; 16 String = 5; 17 Bytes = 6; 18 19 // Mysql specific types. 20 MysqlBit = 101; 21 MysqlDecimal = 102; 22 MysqlDuration = 103; 23 MysqlEnum = 104; 24 MysqlHex = 105; 25 MysqlSet = 106; 26 MysqlTime = 107; 27 28 // Encoded value list. 29 ValueList = 151; 30 31 // Column reference. value is int64 column ID. 32 ColumnRef = 201; 33 34 /* Unary operations, children count 1. */ 35 Not = 1001; 36 Neg = 1002; 37 BitNeg = 1003; 38 39 /* Binary operations, children count 2. */ 40 // Comparison operations. 41 LT = 2001; 42 LE = 2002; 43 EQ = 2003; 44 NE = 2004; 45 GE = 2005; 46 GT = 2006; 47 NullEQ = 2007; 48 49 // Bit operations. 50 BitAnd = 2101; 51 BitOr = 2102; 52 BitXor = 2103; 53 LeftShift = 2104; 54 RighShift = 2105; 55 56 // Arithmatic. 57 Plus = 2201; 58 Minus = 2202; 59 Mul = 2203; 60 Div = 2204; 61 IntDiv = 2205; 62 Mod = 2206; 63 64 // Logic operations. 65 And = 2301; 66 Or = 2302; 67 Xor = 2303; 68 69 /* Mysql functions, children count is function specific. */ 70 // Aggregate functions. 71 Count = 3001; 72 Sum = 3002; 73 Avg = 3003; 74 Min = 3004; 75 Max = 3005; 76 First = 3006; 77 GroupConcat = 3007; 78 79 // Math functions. 80 Abs = 3101; 81 Pow = 3102; 82 83 // String functions. 84 Concat = 3201; 85 ConcatWS = 3202; 86 Left = 3203; 87 Length = 3204; 88 Lower = 3205; 89 Repeat = 3206; 90 Replace = 3207; 91 Upper = 3208; 92 Strcmp = 3209; 93 Convert = 3210; 94 Cast = 3211; 95 Substring = 3212; 96 SubstringIndex = 3213; 97 Locate = 3214; 98 Trim = 3215; 99 100 // Control flow functions. 101 If = 3301; 102 NullIf = 3302; 103 IfNull = 3303; 104 105 // Time functions. 106 Date = 3401; 107 DateAdd = 3402; 108 DateSub = 3403; 109 110 Year = 3411; 111 YearWeek = 3412; 112 113 Month = 3421; 114 115 Week = 3431; 116 Weekday = 3432; 117 WeekOfYear = 3433; 118 119 Day = 3441; 120 DayName = 3442; 121 DayOfYear = 3443; 122 DayOfMonth = 3444; 123 DayOfWeek = 3445; 124 125 Hour = 3451; 126 Minute = 3452; 127 Second = 3453; 128 Microsecond = 3454; 129 130 Extract = 3461; 131 132 // Other functions; 133 Coalesce = 3501; 134 135 /* Other expressions. */ 136 In = 4001; 137 IsTruth = 4002; 138 IsNull = 4003; 139 ExprRow = 4004; 140 Like = 4005; 141 RLike = 4006; 142 Case = 4007; 143 } 144 145 // Evaluators should implement evaluation functions for every expression type. 146 message Expr { 147 optional ExprType tp = 1; 148 optional bytes val = 2; 149 repeated Expr children = 3; 150 }