]>
Commit | Line | Data |
---|---|---|
1d09f67e TL |
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 | include "../../format/Schema.fbs"; | |
19 | ||
20 | namespace org.apache.arrow.computeir.flatbuf; | |
21 | ||
22 | table ListLiteral { | |
23 | values: [Literal] (required); | |
24 | } | |
25 | ||
26 | table StructLiteral { | |
27 | /// Values for each struct field; the order must match the order of fields | |
28 | /// in the `type` field of `Literal`. | |
29 | values: [Literal] (required); | |
30 | } | |
31 | ||
32 | table KeyValue { | |
33 | key: Literal (required); | |
34 | value: Literal (required); | |
35 | } | |
36 | ||
37 | table MapLiteral { | |
38 | values: [KeyValue] (required); | |
39 | } | |
40 | ||
41 | table Int8Literal { | |
42 | value: int8; | |
43 | } | |
44 | ||
45 | table Int16Literal { | |
46 | value: int16; | |
47 | } | |
48 | ||
49 | table Int32Literal { | |
50 | value: int32; | |
51 | } | |
52 | ||
53 | table Int64Literal { | |
54 | value: int64; | |
55 | } | |
56 | ||
57 | table UInt8Literal { | |
58 | value: uint8; | |
59 | } | |
60 | ||
61 | table UInt16Literal { | |
62 | value: uint16; | |
63 | } | |
64 | ||
65 | table UInt32Literal { | |
66 | value: uint32; | |
67 | } | |
68 | ||
69 | table UInt64Literal { | |
70 | value: uint64; | |
71 | } | |
72 | ||
73 | table Float16Literal { | |
74 | value: uint16; | |
75 | } | |
76 | ||
77 | table Float32Literal { | |
78 | value: float32; | |
79 | } | |
80 | ||
81 | table Float64Literal { | |
82 | value: float64; | |
83 | } | |
84 | ||
85 | table DecimalLiteral { | |
86 | /// Bytes of a Decimal value; bytes must be in little-endian order. | |
87 | value: [byte] (required); | |
88 | } | |
89 | ||
90 | table BooleanLiteral { | |
91 | value: bool; | |
92 | } | |
93 | ||
94 | table DateLiteral { | |
95 | value: int64; | |
96 | } | |
97 | ||
98 | table TimeLiteral { | |
99 | value: int64; | |
100 | } | |
101 | ||
102 | table TimestampLiteral { | |
103 | value: int64; | |
104 | } | |
105 | ||
106 | table IntervalLiteralMonths { | |
107 | months: int32; | |
108 | } | |
109 | ||
110 | table IntervalLiteralDaysMilliseconds { | |
111 | days: int32; | |
112 | milliseconds: int32; | |
113 | } | |
114 | ||
115 | union IntervalLiteralImpl { | |
116 | IntervalLiteralMonths, | |
117 | IntervalLiteralDaysMilliseconds, | |
118 | } | |
119 | ||
120 | table IntervalLiteral { | |
121 | value: IntervalLiteralImpl (required); | |
122 | } | |
123 | ||
124 | table DurationLiteral { | |
125 | value: int64; | |
126 | } | |
127 | ||
128 | table BinaryLiteral { | |
129 | value: [byte] (required); | |
130 | } | |
131 | ||
132 | table FixedSizeBinaryLiteral { | |
133 | value: [byte] (required); | |
134 | } | |
135 | ||
136 | table StringLiteral { | |
137 | value: string (required); | |
138 | } | |
139 | ||
140 | // no union literal is defined as only one branch of a union can be resolved. | |
141 | // no literals for large string/binary types as flatbuffer is limited to 2gb. | |
142 | ||
143 | union LiteralImpl { | |
144 | BooleanLiteral, | |
145 | ||
146 | Int8Literal, | |
147 | Int16Literal, | |
148 | Int32Literal, | |
149 | Int64Literal, | |
150 | ||
151 | UInt8Literal, | |
152 | UInt16Literal, | |
153 | UInt32Literal, | |
154 | UInt64Literal, | |
155 | ||
156 | DateLiteral, | |
157 | TimeLiteral, | |
158 | TimestampLiteral, | |
159 | IntervalLiteral, | |
160 | DurationLiteral, | |
161 | ||
162 | DecimalLiteral, | |
163 | ||
164 | Float16Literal, | |
165 | Float32Literal, | |
166 | Float64Literal, | |
167 | ||
168 | ListLiteral, | |
169 | StructLiteral, | |
170 | MapLiteral, | |
171 | ||
172 | StringLiteral, | |
173 | BinaryLiteral, | |
174 | FixedSizeBinaryLiteral, | |
175 | } | |
176 | ||
177 | table Literal { | |
178 | /// Literal value data; for null literals do not include this field. | |
179 | impl: LiteralImpl; | |
180 | /// Type of the literal value. This must match `impl`. | |
181 | type: org.apache.arrow.flatbuf.Field (required); | |
182 | } | |
183 | ||
184 | root_type Literal; |