Skip to content

Commit

Permalink
Parquet: Annotate UUID fields (apache#2913)
Browse files Browse the repository at this point in the history
The spec mandates that UUID fields in Parquet have logical type "UUID"
(https://iceberg.apache.org/spec/#parquet). This is possible to fulfill
after 2366154, as
`LogicalTypeAnnotation.uuidType` was added in Parquet 1.12.0.
  • Loading branch information
findepi authored Aug 3, 2021
1 parent a42a546 commit 9ef0e32
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public Type primitive(PrimitiveType primitive, Type.Repetition repetition, int i
}

case UUID:
return Types.primitive(FIXED_LEN_BYTE_ARRAY, repetition).length(16).id(id).named(name);
return Types.primitive(FIXED_LEN_BYTE_ARRAY, repetition).length(16)
.as(LogicalTypeAnnotation.uuidType())
.id(id)
.named(name);

default:
throw new UnsupportedOperationException("Unsupported type for Parquet: " + primitive);
Expand Down

0 comments on commit 9ef0e32

Please sign in to comment.