Skip to content

Commit

Permalink
PARQUET-758: Add Float16/Half-float logical type
Browse files Browse the repository at this point in the history
Type involves a trade-off of reduced precision,
in exchange for more efficient storage.
  • Loading branch information
anjakefala committed Aug 29, 2022
1 parent 54e53e5 commit 3d4ee46
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions LogicalTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,14 @@ comparison.
To support compatibility with older readers, implementations of parquet-format should
write `DecimalType` precision and scale into the corresponding SchemaElement field in metadata.

### FLOAT16

The `FLOAT16` annotation represents half-precision floating-point numbers in the 2-byte IEEE little-endian format.

Used in contexts where precision is traded off for smaller footprint and potentially better performance.

The primitive type is a 2-byte fixed length binary.

## Temporal Types

### DATE
Expand Down
2 changes: 2 additions & 0 deletions src/main/thrift/parquet.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ 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

/**
* Logical type to annotate a column that is always null.
Expand Down Expand Up @@ -342,6 +343,7 @@ union LogicalType {
12: JsonType JSON // use ConvertedType JSON
13: BsonType BSON // use ConvertedType BSON
14: UUIDType UUID // no compatible ConvertedType
15: Float16Type FLOAT16 // no compatible ConvertedType
}

/**
Expand Down

0 comments on commit 3d4ee46

Please sign in to comment.