Other
Infer Pinot Schema from Avro Schema
In this recipe, we’ll learn how to infer a Pinot schema from an Avro schema.
Pinot Version | 0.9.0 |
---|---|
Code | startreedata/pinot-recipes/infer-schema-avro-data |
Prerequisites
To follow the code examples in this guide, you must install Docker locally and download recipes.
Navigate to recipe
- If you haven’t already, download recipes.
- In the terminal, go to the recipe by running the following command:
JSON Data
We’re going to infer a Pinot schema from the following Avro schema:
/avro/mastodon-topic-value.avsc
Infer schema
Now we’re going to infer a schema for this input file.
We can do this using the AvroSchemaToPinotSchema
command.
You can generate a schema file that creates a dimension column field per Aro field, by running the following command:
A JSON file will be written to ./config/mastodon.json
, the contents of which are shown below:
./config/mastodon.json