Skip to content

Commit 2865642

Browse files
committed
Review feedback, split into FixedSizeListType and VariableSizeListType
1 parent 4f4bd24 commit 2865642

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

LogicalTypes.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,21 @@ The sort order for `FLOAT16` is signed (with special handling of NANs and signed
258258
### FIXED_SIZE_LIST
259259

260260
The `FIXED_SIZE_LIST` annotation represents a fixed-size list of elements
261-
of a primitive data type. It must annotate a `binary` primitive type.
261+
of a primitive data type. It must annotate a `FIXED_LEN_BYTE_ARRAY` primitive type.
262262

263-
The `binary` data is interpreted as a sequence of elements of
264-
the same primitive data type.
263+
The `FIXED_LEN_BYTE_ARRAY` data is interpreted as a fixed size sequence of
264+
elements of the same primitive data type.
265265

266266
The sort order used for `FIXED_SIZE_LIST` is undefined.
267267

268+
### VARIABLE_SIZE_LIST
269+
270+
The `VARIABLE_SIZE_LIST` annotation represents a variable-size list of elements
271+
of a primitive data type. It must annotate a `BYTE_ARRAY` primitive type.
272+
273+
The `BYTE_ARRAY` data is interpreted as a variable size sequence of elements of
274+
the same primitive data type.
275+
268276
## Temporal Types
269277

270278
### DATE

src/main/thrift/parquet.thrift

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,20 @@ struct Statistics {
282282
}
283283

284284
/** Empty structs to use as logical type annotations */
285-
struct StringType {} // allowed for BINARY, must be encoded with UTF-8
286-
struct UUIDType {} // allowed for FIXED[16], must encoded raw UUID bytes
287-
struct MapType {} // see LogicalTypes.md
288-
struct ListType {} // see LogicalTypes.md
289-
struct EnumType {} // allowed for BINARY, must be encoded with UTF-8
290-
struct DateType {} // allowed for INT32
291-
struct Float16Type {} // allowed for FIXED[2], must encoded raw FLOAT16 bytes
292-
struct FixedSizeListType {} // see LogicalTypes.md
285+
struct StringType {} // allowed for BINARY, must be encoded with UTF-8
286+
struct UUIDType {} // allowed for FIXED[16], must encoded raw UUID bytes
287+
struct MapType {} // see LogicalTypes.md
288+
struct ListType {} // see LogicalTypes.md
289+
struct EnumType {} // allowed for BINARY, must be encoded with UTF-8
290+
struct DateType {} // allowed for INT32
291+
struct Float16Type {} // allowed for FIXED[2], must encoded raw FLOAT16 bytes
292+
struct FixedSizeListType { // allowed for FIXED_LEN_BYTE_ARRAY[num_values * width of type],
293+
1: required Type type; // see LogicalTypes.md
294+
2: required i32 num_values;
295+
}
296+
struct VariableSizeListType { // allowed for BYTE_ARRAY, see LogicalTypes.md
297+
1: required Type type;
298+
}
293299

294300
/**
295301
* Logical type to annotate a column that is always null.
@@ -398,14 +404,15 @@ union LogicalType {
398404
8: TimestampType TIMESTAMP
399405

400406
// 9: reserved for INTERVAL
401-
10: IntType INTEGER // use ConvertedType INT_* or UINT_*
402-
11: NullType UNKNOWN // no compatible ConvertedType
403-
12: JsonType JSON // use ConvertedType JSON
404-
13: BsonType BSON // use ConvertedType BSON
405-
14: UUIDType UUID // no compatible ConvertedType
406-
15: Float16Type FLOAT16 // no compatible ConvertedType
407+
10: IntType INTEGER // use ConvertedType INT_* or UINT_*
408+
11: NullType UNKNOWN // no compatible ConvertedType
409+
12: JsonType JSON // use ConvertedType JSON
410+
13: BsonType BSON // use ConvertedType BSON
411+
14: UUIDType UUID // no compatible ConvertedType
412+
15: Float16Type FLOAT16 // no compatible ConvertedType
407413
// 16: reserved for GEOMETRY
408-
17: FixedSizeListType FIXED_SIZE_LIST // no compatible ConvertedType
414+
17: FixedSizeListType FIXED_SIZE_LIST // no compatible ConvertedType
415+
18: VariableSizeListType VARIABLE_SIZE_LIST // no compatible ConvertedType
409416
}
410417

411418
/**

0 commit comments

Comments
 (0)