Skip to main content

Module exporter

Module exporter 

Source
Expand description

Parquet exporter — turns a Workspace into resources.parquet (+ workspace.manifest.json) on disk per 20-parquet-exporter.md.

Phase 3 closes M0 by shipping the single-table flat schema pinned in 10-data-model.md § 3 (24 columns, all non-null with "" / empty-list as the “missing” sentinel). Future phases extend the output with dependencies.parquet, components.parquet, modules.parquet, etc. — same writer pattern, separate file, same atomic-rename guarantee.

§Trust boundary

The exporter consumes only IR — Workspace values are already trusted (they crossed validation at discovery / loader / evaluator land). The one trust boundary the exporter polices is the output path: it refuses to overwrite existing files unless --overwrite is set, and writes atomically via <file>.partialrename (per [99-key-decisions.md] D10).

Modules§

json
Canonical-JSON renderer for the Parquet attributes_json column.

Structs§

ExportOptions
Options for Exporter::export.
ExportReport
Report returned by Exporter::export.
ExportedFile
A single file the exporter produced.
Manifest
Top-level manifest structure.
ManifestFile
Per-file entry in the manifest.
ParquetExporter
Default Exporter backed by arrow-rs + parquet-rs.

Enums§

CompressionOpt
Supported parquet compression codecs. Phase 3 ships the spec’s recommended default — zstd-3. The variant set is #[non_exhaustive] so future codecs can land without a breaking API change.
ExportError
Errors the exporter can raise.
SecondaryTable
Which Parquet table to emit alongside resources.parquet. Phase 8 landed dependencies / components / modules per spec 91 § 11.

Constants§

PARSER_VERSION
Parser version embedded in every emitted row.
SCHEMA_MAJOR
Parquet schema major version. Bumps require a deprecation cycle.
SCHEMA_MINOR
Parquet schema minor version. Bumps are additive.

Traits§

Exporter
Trait for workspace exporters. Phase 3 ships ParquetExporter; tests may swap in a stub that records calls without touching disk.

Functions§

components_field_names
Column names in declaration order.
components_schema
Build the canonical components.parquet schema (spec 15 § 5).
dependencies_field_names
Column names in declaration order.
dependencies_schema
Build the canonical dependencies.parquet schema (spec 10 § 5.1).
modules_field_names
Column names in declaration order.
modules_schema
Build the canonical modules.parquet schema (spec 10 § 5.3).
resources_schema
Build the canonical resources.parquet schema.
schema_field_names
Ordered list of column names for the resources schema.
write_manifest
Write the manifest atomically (.partial → rename). Returns the byte size on disk after the rename.