Skip to content

Commit 4a18ab8

Browse files
authored
Update MLIR docs
1 parent 4f0d99a commit 4a18ab8

File tree

7 files changed

+5876
-0
lines changed

7 files changed

+5876
-0
lines changed
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
# 'arrow' Dialect
3+
4+
The Arrow dialect provides types and operations for working with Apache Arrow data structures.
5+
It includes types for arrays and builders (for chunked arrays), and the necessary operations to load values from arrays, and append values to builders.
6+
7+
The operation implemented by this dialect work directly on the physical memory layout, and do not have any knowledge about Apache Arrow's logical types.
8+
For example, dates are loaded as integers, strings are loaded as ptr + len, and so on.
9+
Dealing with logical types is the responsibility of higher-level dialects.
10+
11+
12+
## Operations
13+
14+
### `arrow.array.is_valid` (::lingodb::compiler::dialect::arrow::IsValidOp)
15+
16+
_Returns if a array element at a given offset is valid or not._
17+
18+
19+
Syntax:
20+
21+
```
22+
operation ::= `arrow.array.is_valid` $array `,` $offset attr-dict
23+
```
24+
25+
26+
Interfaces: `InferTypeOpInterface`
27+
28+
#### Operands:
29+
30+
| Operand | Description |
31+
| :-----: | ----------- |
32+
| `array` | represents an anonymous Apache Arrow array, without knowledge of the type stored by it
33+
| `offset` | index
34+
35+
#### Results:
36+
37+
| Result | Description |
38+
| :----: | ----------- |
39+
| `valid` | 1-bit signless integer
40+
41+
42+
### `arrow.array.load_bool` (::lingodb::compiler::dialect::arrow::LoadBoolOp)
43+
44+
_Loads a boolean value from an array at a given offset._
45+
46+
47+
Syntax:
48+
49+
```
50+
operation ::= `arrow.array.load_bool` $array `,` $offset attr-dict
51+
```
52+
53+
This special operation is necessary, since Arrow stores boolean values as bitset, and not individual bytes.
54+
55+
Interfaces: `InferTypeOpInterface`
56+
57+
#### Operands:
58+
59+
| Operand | Description |
60+
| :-----: | ----------- |
61+
| `array` | represents an anonymous Apache Arrow array, without knowledge of the type stored by it
62+
| `offset` | index
63+
64+
#### Results:
65+
66+
| Result | Description |
67+
| :----: | ----------- |
68+
| `value` | 1-bit signless integer
69+
70+
71+
### `arrow.array.load_fixed_sized` (::lingodb::compiler::dialect::arrow::LoadFixedSizedOp)
72+
73+
_Loads an arbitrary, fixed sized value from an array at a given offset_
74+
75+
76+
Syntax:
77+
78+
```
79+
operation ::= `arrow.array.load_fixed_sized` $array `,` $offset `->` type($value) attr-dict
80+
```
81+
82+
Used for loading types that are of fixed size from an arrow array (e.g., integers, floats, decimals, dates, timestamp).
83+
There are now runtime checks to ensure that the type of the value matches the type of the array, so this operation can be used for any fixed sized type.
84+
85+
#### Operands:
86+
87+
| Operand | Description |
88+
| :-----: | ----------- |
89+
| `array` | represents an anonymous Apache Arrow array, without knowledge of the type stored by it
90+
| `offset` | index
91+
92+
#### Results:
93+
94+
| Result | Description |
95+
| :----: | ----------- |
96+
| `value` | any type
97+
98+
99+
### `arrow.array.load_variable_size_binary` (::lingodb::compiler::dialect::arrow::LoadVariableSizeBinaryOp)
100+
101+
_Loads a variable sized binary value from an array at a given offset_
102+
103+
104+
Syntax:
105+
106+
```
107+
operation ::= `arrow.array.load_variable_size_binary` $array `,` $offset `->` type($ptr) attr-dict
108+
```
109+
110+
Used for loading variable sized binary values from an arrow array (e.g., strings, binary data).
111+
It returns both a pointer to the data and the length of the data.
112+
113+
Interfaces: `InferTypeOpInterface`
114+
115+
#### Operands:
116+
117+
| Operand | Description |
118+
| :-----: | ----------- |
119+
| `array` | represents an anonymous Apache Arrow array, without knowledge of the type stored by it
120+
| `offset` | index
121+
122+
#### Results:
123+
124+
| Result | Description |
125+
| :----: | ----------- |
126+
| `length` | 32-bit signless integer
127+
| `ptr` | ref type
128+
129+
130+
### `arrow.array_builder.append_bool` (::lingodb::compiler::dialect::arrow::AppendBoolOp)
131+
132+
_Appends a boolean value to an Arrow array builder._
133+
134+
135+
Syntax:
136+
137+
```
138+
operation ::= `arrow.array_builder.append_bool` $builder `,` $value ( `,` $valid^ )? attr-dict
139+
```
140+
141+
This operation appends a boolean value to an Arrow array builder, optionally with a validity flag.
142+
This operation is necessary because Arrow stores boolean values as a bitset, not as individual bytes.
143+
144+
#### Operands:
145+
146+
| Operand | Description |
147+
| :-----: | ----------- |
148+
| `builder` | represents an anonymous Apache Arrow builder (building a chunked array), without knowledge of the type stored by it
149+
| `value` | 1-bit signless integer
150+
| `valid` | 1-bit signless integer
151+
152+
153+
### `arrow.array_builder.append_fixed_sized` (::lingodb::compiler::dialect::arrow::AppendFixedSizedOp)
154+
155+
_Appends a fixed sized value to an Arrow array builder._
156+
157+
158+
Syntax:
159+
160+
```
161+
operation ::= `arrow.array_builder.append_fixed_sized` $builder `,` $value `:` type($value) ( `,` $valid^ )? attr-dict
162+
```
163+
164+
This operation appends a fixed sized value to an Arrow array builder, optionally with a validity flag.
165+
It can be used for any fixed sized type, such as integers, floats, decimals, dates, and timestamps.
166+
167+
#### Operands:
168+
169+
| Operand | Description |
170+
| :-----: | ----------- |
171+
| `builder` | represents an anonymous Apache Arrow builder (building a chunked array), without knowledge of the type stored by it
172+
| `value` | any type
173+
| `valid` | 1-bit signless integer
174+
175+
176+
### `arrow.array_builder.append_variable_sized_binary` (::lingodb::compiler::dialect::arrow::AppendVariableSizeBinaryOp)
177+
178+
_Appends a variable sized binary value to an Arrow array builder._
179+
180+
181+
Syntax:
182+
183+
```
184+
operation ::= `arrow.array_builder.append_variable_sized_binary` $builder `,` $value ( `,` $valid^ )? attr-dict
185+
```
186+
187+
This operation appends a variable sized binary value to an Arrow array builder, optionally with a validity flag
188+
The binary data is (at the moment) expected to be a util.varlen32 type, which contains pointer and length information.
189+
In the future, we should return a pointer and length directly.
190+
191+
#### Operands:
192+
193+
| Operand | Description |
194+
| :-----: | ----------- |
195+
| `builder` | represents an anonymous Apache Arrow builder (building a chunked array), without knowledge of the type stored by it
196+
| `value` | type representing variable-length data up to 2^31 bytes
197+
| `valid` | 1-bit signless integer
198+
199+
200+
### `arrow.array_builder.from_ptr` (::lingodb::compiler::dialect::arrow::BuilderFromPtr)
201+
202+
_Creates a builder value from a pointer to an ArrowColumn builder that is managed in the runtime_
203+
204+
205+
Syntax:
206+
207+
```
208+
operation ::= `arrow.array_builder.from_ptr` $ptr `->` type($builder) attr-dict
209+
```
210+
211+
212+
Interfaces: `InferTypeOpInterface`
213+
214+
#### Operands:
215+
216+
| Operand | Description |
217+
| :-----: | ----------- |
218+
| `ptr` | ref type
219+
220+
#### Results:
221+
222+
| Result | Description |
223+
| :----: | ----------- |
224+
| `builder` | represents an anonymous Apache Arrow builder (building a chunked array), without knowledge of the type stored by it
225+
226+
227+
## Types
228+
229+
### ArrayType
230+
231+
represents an anonymous Apache Arrow array, without knowledge of the type stored by it
232+
233+
Syntax: `!arrow.array`
234+
235+
236+
237+
### ArrayBuilderType
238+
239+
represents an anonymous Apache Arrow builder (building a chunked array), without knowledge of the type stored by it
240+
241+
Syntax: `!arrow.builder`
242+
243+
244+

0 commit comments

Comments
 (0)