Skip to content

Commit 807db51

Browse files
committed
move information to schema
1 parent f2f0596 commit 807db51

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

format/Message.fbs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ table Field {
107107
// present only if the field is dictionary encoded
108108
// will point to a dictionary provided by a DictionaryBatch message
109109
dictionary: long;
110+
/// the buffers produced for this type (as derived from the Type)
111+
/// does not include children
112+
/// each recordbatch will return instances of those Buffers.
113+
buffers: [ VectorType ];
110114
// children apply only to Nested data types like Struct, List and Union
111115
children: [Field];
112116
}
@@ -145,7 +149,7 @@ enum VectorType: short {
145149
}
146150

147151
/// A Buffer represents a single contiguous memory segment
148-
table Buffer {
152+
struct Buffer {
149153
/// The shared memory page id where this buffer is located. Currently this is
150154
/// not used
151155
page: int;
@@ -157,9 +161,6 @@ table Buffer {
157161
/// The absolute length (in bytes) of the memory buffer. The memory is found
158162
/// from offset (inclusive) to offset + length (non-inclusive).
159163
length: long;
160-
161-
/// the type of the vector to be explicit
162-
type: VectorType;
163164
}
164165

165166
/// Metadata about a field at some level of a nested type tree (but not
@@ -168,7 +169,7 @@ table Buffer {
168169
/// For example, a List<Int16> with values [[1, 2, 3], null, [4], [5, 6], null]
169170
/// would have {length: 5, null_count: 2} for its List node, and {length: 6,
170171
/// null_count: 0} for its Int16 node, as separate FieldNode structs
171-
table FieldNode {
172+
struct FieldNode {
172173
/// The number of value slots in the Arrow array at this level of a nested
173174
/// tree
174175
length: int;
@@ -177,30 +178,26 @@ table FieldNode {
177178
/// to write their physical validity bitmap out as a materialized buffer,
178179
/// instead setting the length of the bitmap buffer to 0.
179180
null_count: int;
180-
181-
/// children according to the schema
182-
children: [FieldNode];
183-
184-
/// Buffers correspond to the pre-ordered flattened buffer tree
185-
///
186-
/// The number of buffers appended to this list depends on the field type and length.
187-
/// For example, most primitive arrays will have 2 buffers, 1 for the validity
188-
/// bitmap and 1 for the values. For struct arrays, there will only be a
189-
/// single buffer for the validity (nulls) bitmap
190-
vectors: [Buffer];
191181
}
192182

193183
/// A data header describing the shared memory layout of a "record" or "row"
194184
/// batch. Some systems call this a "row batch" internally and others a "record
195185
/// batch".
196186
table RecordBatch {
197-
/// number of records / rows. The root arrays in the batch should all have this
187+
/// number of records / rows. The arrays in the batch should all have this
198188
/// length
199189
length: int;
200190

201-
/// Nodes correspond to the first level of the logical schema
191+
/// Nodes correspond to the pre-ordered flattened logical schema
202192
nodes: [FieldNode];
203193

194+
/// Buffers correspond to the pre-ordered flattened buffer tree
195+
///
196+
/// The number of buffers appended to this list depends on the schema. For
197+
/// example, most primitive arrays will have 2 buffers, 1 for the validity
198+
/// bitmap and 1 for the values. For struct arrays, there will only be a
199+
/// single buffer for the validity (nulls) bitmap
200+
buffers: [Buffer];
204201
}
205202

206203
/// ----------------------------------------------------------------------

0 commit comments

Comments
 (0)