Skip to content

Commit a73b0f7

Browse files
committed
Clarify the use of Structs vs Maps #34
1 parent 82b536b commit a73b0f7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

geoparquet/datatypes.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ It also shows the mapping to the GeoParquet data types.
1919
| binary | BYTE_ARRAY | as string, base64-encoded |
2020
| string<br />charset: UTF-8 | STRING (BYTE_ARRAY) | yes |
2121
| array | LIST | yes |
22-
| object<br />keys: string<br />values: any | STRUCT / MAP | yes |
22+
| object<br />keys: string<br />values: any | STRUCT or MAP (see below) | yes |
2323
| date | DATE (INT32) | as string, compliant to ISO8601 |
2424
| date-time<br />with milliseconds<br />timezone: UTC | TimestampType (INT64)<br />isAdjustedToUTC: true<br />unit: MILLIS<br />(deprecated: TIMESTAMP_MILLIS) | as string, compliant to ISO8601 |
2525
| geometry | BYTE_ARRAY<br />encoded as WKB | no |
@@ -29,6 +29,14 @@ It also shows the mapping to the GeoParquet data types.
2929
The integer data types and the data type string can also be mapped to the ENUM data type in Parquet
3030
if a pre-defined set of values is available.
3131

32+
## Struct vs Map
33+
34+
Parquet has both Map and Struct types. The struct type is similar to a named dictionary while the map type is similar to a list of ordered (key, value) pairs. The main difference is that you need to know up-front the keys for the struct type, while you don't for the map type.
35+
36+
Due to this difference, the **Struct** type can only be used if `additionalProperties` is `false` (the default value) and only `properties` is provided to clearly specify the exact names of the properties.
37+
38+
Any variability in the keys through the use of `additionalProperties` (except for the default `false`) or `patternProperties` requires the use of the **Map** data type. Please note that the order of the Map type is guaranteed to be preserved.
39+
3240
## Unsupported Data Types
3341

3442
The following data types occur in Parquet, but are not currently supported in fiboa:

0 commit comments

Comments
 (0)