]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/cpp/src/gandiva/proto/Types.proto
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / src / gandiva / proto / Types.proto
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
16 // under the License.
17
18 syntax = "proto2";
19 package types;
20
21 option java_package = "org.apache.arrow.gandiva.ipc";
22 option java_outer_classname = "GandivaTypes";
23 option optimize_for = SPEED;
24
25 enum GandivaType {
26 NONE = 0; // arrow::Type::NA
27 BOOL = 1; // arrow::Type::BOOL
28 UINT8 = 2; // arrow::Type::UINT8
29 INT8 = 3; // arrow::Type::INT8
30 UINT16 = 4; // represents arrow::Type fields in src/arrow/type.h
31 INT16 = 5;
32 UINT32 = 6;
33 INT32 = 7;
34 UINT64 = 8;
35 INT64 = 9;
36 HALF_FLOAT = 10;
37 FLOAT = 11;
38 DOUBLE = 12;
39 UTF8 = 13;
40 BINARY = 14;
41 FIXED_SIZE_BINARY = 15;
42 DATE32 = 16;
43 DATE64 = 17;
44 TIMESTAMP = 18;
45 TIME32 = 19;
46 TIME64 = 20;
47 INTERVAL = 21;
48 DECIMAL = 22;
49 LIST = 23;
50 STRUCT = 24;
51 UNION = 25;
52 DICTIONARY = 26;
53 MAP = 27;
54 }
55
56 enum DateUnit {
57 DAY = 0;
58 MILLI = 1;
59 }
60
61 enum TimeUnit {
62 SEC = 0;
63 MILLISEC = 1;
64 MICROSEC = 2;
65 NANOSEC = 3;
66 }
67
68 enum IntervalType {
69 YEAR_MONTH = 0;
70 DAY_TIME = 1;
71 }
72
73 enum SelectionVectorType {
74 SV_NONE = 0;
75 SV_INT16 = 1;
76 SV_INT32 = 2;
77 }
78
79 message ExtGandivaType {
80 optional GandivaType type = 1;
81 optional uint32 width = 2; // used by FIXED_SIZE_BINARY
82 optional int32 precision = 3; // used by DECIMAL
83 optional int32 scale = 4; // used by DECIMAL
84 optional DateUnit dateUnit = 5; // used by DATE32/DATE64
85 optional TimeUnit timeUnit = 6; // used by TIME32/TIME64
86 optional string timeZone = 7; // used by TIMESTAMP
87 optional IntervalType intervalType = 8; // used by INTERVAL
88 }
89
90 message Field {
91 // name of the field
92 optional string name = 1;
93 optional ExtGandivaType type = 2;
94 optional bool nullable = 3;
95 // for complex data types like structs, unions
96 repeated Field children = 4;
97 }
98
99 message FieldNode {
100 optional Field field = 1;
101 }
102
103 message FunctionNode {
104 optional string functionName = 1;
105 repeated TreeNode inArgs = 2;
106 optional ExtGandivaType returnType = 3;
107 }
108
109 message IfNode {
110 optional TreeNode cond = 1;
111 optional TreeNode thenNode = 2;
112 optional TreeNode elseNode = 3;
113 optional ExtGandivaType returnType = 4;
114 }
115
116 message AndNode {
117 repeated TreeNode args = 1;
118 }
119
120 message OrNode {
121 repeated TreeNode args = 1;
122 }
123
124 message NullNode {
125 optional ExtGandivaType type = 1;
126 }
127
128 message IntNode {
129 optional int32 value = 1;
130 }
131
132 message FloatNode {
133 optional float value = 1;
134 }
135
136 message DoubleNode {
137 optional double value = 1;
138 }
139
140 message BooleanNode {
141 optional bool value = 1;
142 }
143
144 message LongNode {
145 optional int64 value = 1;
146 }
147
148 message StringNode {
149 optional bytes value = 1;
150 }
151
152 message BinaryNode {
153 optional bytes value = 1;
154 }
155
156 message DecimalNode {
157 optional string value = 1;
158 optional int32 precision = 2;
159 optional int32 scale = 3;
160 }
161
162
163 message TreeNode {
164 optional FieldNode fieldNode = 1;
165 optional FunctionNode fnNode = 2;
166
167 // control expressions
168 optional IfNode ifNode = 6;
169 optional AndNode andNode = 7;
170 optional OrNode orNode = 8;
171
172 // literals
173 optional NullNode nullNode = 11;
174 optional IntNode intNode = 12;
175 optional FloatNode floatNode = 13;
176 optional LongNode longNode = 14;
177 optional BooleanNode booleanNode = 15;
178 optional DoubleNode doubleNode = 16;
179 optional StringNode stringNode = 17;
180 optional BinaryNode binaryNode = 18;
181 optional DecimalNode decimalNode = 19;
182
183 // in expr
184 optional InNode inNode = 21;
185 }
186
187 message ExpressionRoot {
188 optional TreeNode root = 1;
189 optional Field resultType = 2;
190 }
191
192 message ExpressionList {
193 repeated ExpressionRoot exprs = 2;
194 }
195
196 message Condition {
197 optional TreeNode root = 1;
198 }
199
200 message Schema {
201 repeated Field columns = 1;
202 }
203
204 message GandivaDataTypes {
205 repeated ExtGandivaType dataType = 1;
206 }
207
208 message GandivaFunctions {
209 repeated FunctionSignature function = 1;
210 }
211
212 message FunctionSignature {
213 optional string name = 1;
214 optional ExtGandivaType returnType = 2;
215 repeated ExtGandivaType paramTypes = 3;
216 }
217
218 message InNode {
219 optional TreeNode node = 1;
220 optional IntConstants intValues = 2;
221 optional LongConstants longValues = 3;
222 optional StringConstants stringValues = 4;
223 optional BinaryConstants binaryValues = 5;
224 optional DecimalConstants decimalValues = 6;
225 optional FloatConstants floatValues = 7;
226 optional DoubleConstants doubleValues = 8;
227 }
228
229 message IntConstants {
230 repeated IntNode intValues = 1;
231 }
232
233 message LongConstants {
234 repeated LongNode longValues = 1;
235 }
236
237 message DecimalConstants {
238 repeated DecimalNode decimalValues = 1;
239 }
240
241 message FloatConstants {
242 repeated FloatNode floatValues = 1;
243 }
244
245 message DoubleConstants {
246 repeated DoubleNode doubleValues = 1;
247 }
248
249 message StringConstants {
250 repeated StringNode stringValues = 1;
251 }
252
253 message BinaryConstants {
254 repeated BinaryNode binaryValues = 1;
255 }