Segment.Road is varchar not struct #122
-
Hi, in the January edition I find that the segment/road column is varchar, not struct, which makes it hard to parse.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I found the struct_pack function to make a struct but ideally the data should come as struct. |
Beta Was this translation helpful? Give feedback.
-
This is a known issue due to some of the dynamic "oneOf" typing in the current JSON schema (https://github.com/OvertureMaps/schema/blob/main/schema/transportation/segment.yaml#L147-L160). These don't translate well to Parquet which requires strict typing so the current solution casts to a JSON string unfortunately. We are working to fix these in the schema and you'll soon see the struct you expect. However you can use the JSON functions in Duckdb (https://duckdb.org/docs/extensions/json.html). Here's an example:
|
Beta Was this translation helpful? Give feedback.
-
March 12 release is still varchar for roads :-( |
Beta Was this translation helpful? Give feedback.
This is a known issue due to some of the dynamic "oneOf" typing in the current JSON schema (https://github.com/OvertureMaps/schema/blob/main/schema/transportation/segment.yaml#L147-L160). These don't translate well to Parquet which requires strict typing so the current solution casts to a JSON string unfortunately. We are working to fix these in the schema and you'll soon see the struct you expect.
However you can use the JSON functions in Duckdb (https://duckdb.org/docs/extensions/json.html).
Here's an example: