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
9 // http://www.apache.org/licenses/LICENSE-2.0
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
21 option java_package = "org.apache.arrow.gandiva.ipc";
22 option java_outer_classname = "GandivaTypes";
23 option optimize_for = SPEED;
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
41 FIXED_SIZE_BINARY = 15;
73 enum SelectionVectorType {
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
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;
100 optional Field field = 1;
103 message FunctionNode {
104 optional string functionName = 1;
105 repeated TreeNode inArgs = 2;
106 optional ExtGandivaType returnType = 3;
110 optional TreeNode cond = 1;
111 optional TreeNode thenNode = 2;
112 optional TreeNode elseNode = 3;
113 optional ExtGandivaType returnType = 4;
117 repeated TreeNode args = 1;
121 repeated TreeNode args = 1;
125 optional ExtGandivaType type = 1;
129 optional int32 value = 1;
133 optional float value = 1;
137 optional double value = 1;
140 message BooleanNode {
141 optional bool value = 1;
145 optional int64 value = 1;
149 optional bytes value = 1;
153 optional bytes value = 1;
156 message DecimalNode {
157 optional string value = 1;
158 optional int32 precision = 2;
159 optional int32 scale = 3;
164 optional FieldNode fieldNode = 1;
165 optional FunctionNode fnNode = 2;
167 // control expressions
168 optional IfNode ifNode = 6;
169 optional AndNode andNode = 7;
170 optional OrNode orNode = 8;
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;
184 optional InNode inNode = 21;
187 message ExpressionRoot {
188 optional TreeNode root = 1;
189 optional Field resultType = 2;
192 message ExpressionList {
193 repeated ExpressionRoot exprs = 2;
197 optional TreeNode root = 1;
201 repeated Field columns = 1;
204 message GandivaDataTypes {
205 repeated ExtGandivaType dataType = 1;
208 message GandivaFunctions {
209 repeated FunctionSignature function = 1;
212 message FunctionSignature {
213 optional string name = 1;
214 optional ExtGandivaType returnType = 2;
215 repeated ExtGandivaType paramTypes = 3;
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;
229 message IntConstants {
230 repeated IntNode intValues = 1;
233 message LongConstants {
234 repeated LongNode longValues = 1;
237 message DecimalConstants {
238 repeated DecimalNode decimalValues = 1;
241 message FloatConstants {
242 repeated FloatNode floatValues = 1;
245 message DoubleConstants {
246 repeated DoubleNode doubleValues = 1;
249 message StringConstants {
250 repeated StringNode stringValues = 1;
253 message BinaryConstants {
254 repeated BinaryNode binaryValues = 1;