Skip to content

[WIP] Add conversion from JSON structure to Parquet schema - #78

Closed
clemensv with Copilot wants to merge 3 commits into
masterfrom
copilot/add-json-structure-to-parquet
Closed

[WIP] Add conversion from JSON structure to Parquet schema#78
clemensv with Copilot wants to merge 3 commits into
masterfrom
copilot/add-json-structure-to-parquet

Conversation

Copilot AI commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

Implementation Plan: JSON Structure to Parquet Conversion

  • Explore repository structure and understand existing patterns
  • Study avrotoparquet.py for Parquet output patterns
  • Study structuretopython.py and structuretocsharp.py for JSON Structure handling
  • Run existing tests to ensure environment is set up
  • Create structuretoparquet.py module
    • Implement StructureToParquetConverter class
    • Map JSON Structure types to PyArrow types
    • Handle compound types (object, array, set, map, tuple, choice)
    • Support $ref, $extends, namespaces, definitions
    • Handle required/optional properties
    • Support type annotations (maxLength, precision, scale, etc.)
  • Add command definition to commands.json
  • Add function mapping to init.py
  • Create test file test_structuretoparquet.py
  • Run tests and validate implementation
  • Run linters and fix any issues
  • Final validation and cleanup
Original prompt

This section details on the original issue you should resolve

<issue_title>Add structuretoparquet: JSON Structure to Parquet conversion</issue_title>
<issue_description>## Overview
Implement conversion from JSON Structure schemas to Apache Parquet schema.

Requirements

This conversion should:

  1. Lean on the corresponding Avro conversion (avrotoparquet) as precedent for output structure, including use of Jinja templates where applicable
  2. Cover the full breadth of the JSON Structure Core spec as defined in draft-vasters-json-structure-core-00
  3. Follow the patterns established by structuretocsharp and structuretopython, including their continued support for Avro schemas

Implementation Guidance

  • Review avrotize/avrotoparquet.py for output patterns and template usage
  • Review avrotize/structuretocsharp.py and avrotize/structuretopython.py for the JSON Structure handling patterns
  • Ensure all JSON Structure Core types are supported:
    • JSON Primitive Types: string, number, boolean, null
    • Extended Primitive Types: binary, int8-128, uint8-128, float8/float/double, decimal, date, datetime, time, duration, uuid, uri, jsonpointer
    • Compound Types: object, array, set, map, tuple, any, choice (both tagged and inline unions)
  • Support JSON Structure-specific features:
    • Namespaces and definitions
    • Type references ($ref)
    • Extensions ($extends) and add-ins ($offers/$uses)
    • Abstract types
    • Required/optional properties
    • Type annotations (maxLength, precision, scale, contentEncoding, etc.)

References

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 20, 2025 07:56
Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
Co-authored-by: clemensv <542030+clemensv@users.noreply.github.com>
@clemensv

Copy link
Copy Markdown
Owner

@copilot

Additional Requirements

Documentation

The README.md file needs to be updated to include documentation for this new conversion feature, following the pattern established for existing conversions.

Testing

All tests must follow the established testing patterns:

  • For programming language outputs (C#, Java, Python, TypeScript, JavaScript, C++, Go, Rust): Tests must run the embedded tests in the code outputs to verify correctness
  • For schema language outputs (CSV, Protobuf, XSD, GraphQL, etc.): Tests must compare the generated output to a desired output reference (-ref) schema stored in the /test/struct directory

This follows the pattern established for the Avro conversion tests in the repository.

@clemensv

Copy link
Copy Markdown
Owner

Closing duplicate PR for Parquet conversion. Keeping the newer PR #93 for this issue.

@clemensv clemensv closed this Nov 20, 2025
@clemensv
clemensv deleted the copilot/add-json-structure-to-parquet branch November 20, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add structuretoparquet: JSON Structure to Parquet conversion

2 participants