Skip to content

Commit

Permalink
Add FIXED_SIZE_LIST
Browse files Browse the repository at this point in the history
  • Loading branch information
rok committed May 15, 2024
1 parent 04fbaca commit 795fa31
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 13 deletions.
12 changes: 12 additions & 0 deletions LogicalTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,18 @@ The primitive type is a 2-byte fixed length binary.

The sort order for `FLOAT16` is signed (with special handling of NANs and signed zeros); it uses the same [logic](https://github.com/apache/parquet-format#sort-order) as `FLOAT` and `DOUBLE`.

### FIXED_SIZE_LIST

The `FIXED_SIZE_LIST` annotation represents a fixed-size list of elements
of a fixed-width data type. It must annotate an N-byte fixed length binary
where N is the number of elements in the list times bit width of the element
data type.

The `fixed_len_byte_array` data is interpreted as a sequence of elements of
the same fixed-width data type.

The sort order used for `FIXED_SIZE_LIST` is undefined.

## Temporal Types

### DATE
Expand Down
29 changes: 16 additions & 13 deletions src/main/thrift/parquet.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,14 @@ struct Statistics {
}

/** Empty structs to use as logical type annotations */
struct StringType {} // allowed for BINARY, must be encoded with UTF-8
struct UUIDType {} // allowed for FIXED[16], must encoded raw UUID bytes
struct MapType {} // see LogicalTypes.md
struct ListType {} // see LogicalTypes.md
struct EnumType {} // allowed for BINARY, must be encoded with UTF-8
struct DateType {} // allowed for INT32
struct Float16Type {} // allowed for FIXED[2], must encoded raw FLOAT16 bytes
struct StringType {} // allowed for BINARY, must be encoded with UTF-8
struct UUIDType {} // allowed for FIXED[16], must encoded raw UUID bytes
struct MapType {} // see LogicalTypes.md
struct ListType {} // see LogicalTypes.md
struct EnumType {} // allowed for BINARY, must be encoded with UTF-8
struct DateType {} // allowed for INT32
struct Float16Type {} // allowed for FIXED[2], must encoded raw FLOAT16 bytes
struct FixedSizeListType {} // see LogicalTypes.md

/**
* Logical type to annotate a column that is always null.
Expand Down Expand Up @@ -397,12 +398,14 @@ union LogicalType {
8: TimestampType TIMESTAMP

// 9: reserved for INTERVAL
10: IntType INTEGER // use ConvertedType INT_* or UINT_*
11: NullType UNKNOWN // no compatible ConvertedType
12: JsonType JSON // use ConvertedType JSON
13: BsonType BSON // use ConvertedType BSON
14: UUIDType UUID // no compatible ConvertedType
15: Float16Type FLOAT16 // no compatible ConvertedType
10: IntType INTEGER // use ConvertedType INT_* or UINT_*
11: NullType UNKNOWN // no compatible ConvertedType
12: JsonType JSON // use ConvertedType JSON
13: BsonType BSON // use ConvertedType BSON
14: UUIDType UUID // no compatible ConvertedType
15: Float16Type FLOAT16 // no compatible ConvertedType
// 16: reserved for GEOMETRY
17: FixedSizeListType FIXED_SIZE_LIST // no compatible ConvertedType
}

/**
Expand Down

0 comments on commit 795fa31

Please sign in to comment.