Skip to content

Segment.Road is varchar not struct #122

Discussion options

You must be logged in to vote

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:

D select id, cast(json_extract(road, '$.class')as varchar) from read_parquet('./overture-road.parquet') limit 10;
┌──────────────────────────────────┬─────────────────────────────…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@BruceHarold
Comment options

Answer selected by BruceHarold
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants