Skip to main content

Parquet / Avro Schema Generator

Paste a JSON sample and automatically detect field names and types. Get an Avro schema (JSON), PyArrow Parquet schema, and Python code to create both — including support for nested objects and arrays.

✓ Avro JSON schema ✓ PyArrow Parquet schema ✓ Nested objects & arrays

JSON Sample Data

Frequently Asked Questions

What is the difference between Parquet and Avro?▼

Parquet is a columnar storage format optimized for analytical reads — great for SELECT queries on a subset of columns in data lakes (S3, GCS). Avro is a row-based format optimized for serialization and streaming — ideal for Kafka messages and event schemas. Rule of thumb: Avro for writing/streaming, Parquet for reading/analytics. Many pipelines use Avro in Kafka and convert to Parquet when landing in a data lake.

What is schema evolution in Avro?▼

Schema evolution allows you to change the schema over time while maintaining backward/forward compatibility. Avro supports: adding optional fields (with defaults), removing optional fields, renaming via aliases. Breaking changes: changing field types, removing required fields, reordering fields. Use a Schema Registry (Confluent) to manage schema versions and enforce compatibility rules across producers and consumers.

How are JSON types mapped to Avro types?▼

JSON string → Avro 'string'. JSON number (integer) → Avro 'long' or 'int'. JSON number (float) → Avro 'double' or 'float'. JSON boolean → Avro 'boolean'. JSON null → Avro 'null'. JSON object → Avro 'record'. JSON array → Avro 'array'. Avro also supports 'bytes', 'fixed', 'enum', 'map', and 'union' types not directly representable in JSON.

How are JSON types mapped to PyArrow Parquet types?▼

JSON string → pa.string() or pa.large_string(). JSON integer → pa.int64(). JSON float → pa.float64(). JSON boolean → pa.bool_(). JSON null → optional field (pa.field nullable=True). JSON object → pa.struct(). JSON array → pa.list_(). PyArrow infers the best type from data. Use pa.schema() to enforce strict types and catch schema violations early in your pipeline.

Should I store nested JSON as-is or flatten it?▼

Storing nested JSON as-is in Parquet (using struct/list types) preserves structure but complicates queries in SQL engines. Flattening (expanding nested fields to top-level columns) improves query performance and compatibility but loses the hierarchy. Best practice: flatten one level deep for frequently-queried fields, keep rare nested data as JSON string. BigQuery and Snowflake both support STRUCT natively, making nested Parquet efficient for those platforms.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →