Skip to content

materialize-s3-json: new connector writing gzipped NDJSON - #5253

Open
SeanWhelan wants to merge 1 commit into
mainfrom
sean/materialize-s3-json
Open

SeanWhelan wants to merge 1 commit into
mainfrom
sean/materialize-s3-json

Conversation

@SeanWhelan

Copy link
Copy Markdown
Contributor

Description:

Adds materialize-s3-json, a third object-store file format alongside the existing CSV and Parquet sinks. Each line of a materialized file is one JSON document, gzip compressed and written as .json.gz. Object and array fields are written as nested JSON rather than encoded strings.

The connector is materialize-s3-csv with the writer and file extension swapped. The new filesink.NewJsonStreamWriter wraps writer.JsonWriter, which already satisfies filesink.StreamWriter and is what the Redshift, Databricks, BigQuery, MotherDuck and Snowflake stagers use, so there is no new serialization code here.

Workflow steps:

Same as the CSV and Parquet S3 connectors: configure bucket, region, credentials, optional prefix and upload interval, then one binding per collection with a path. The only format-specific option is jsonConfig.skipNulls, which omits null-valued fields instead of writing them as null.

Notes for reviewers:

The file extension is .json.gz rather than .jsonl.gz. The contents are newline-delimited, but .json is what materialize-motherduck already stages NDJSON as, and it is what Athena, Glue crawlers and Snowflake key off. Easy to change if you'd rather be literal.

writer.WithJsonSkipNulls had no test coverage anywhere, so TestJsonWriterSkipNulls is added next to the existing writer tests. Nothing was added to filesink, which does not test its other format constructors.

Requested by a customer who asked for JSON output from the S3 materialization. Still needs a control-plane connectors row, a UI tile, and the go.estuary.dev/materialize-s3-json short link, none of which live in this repo.

Checklist:

  • Not a regression.
  • No CHANGELOG.md: the connector is new, so there is no prior behaviour to describe a change to. materialize-s3-csv likewise has none.
  • Docs added in this PR: new amazon-s3-json.md page plus the materialization-connectors index entry.

…JSON

Adds a JSON file format alongside the existing CSV and Parquet object-store
sinks. Each line of a materialized file is a single JSON document, gzip
compressed and written as `.json.gz`, matching the extension already used for
staged newline-delimited JSON elsewhere in the repo.

The format helper wraps `writer.JsonWriter`, which already satisfies
`filesink.StreamWriter` and is in use by the Redshift, Databricks, BigQuery,
MotherDuck and Snowflake stagers, so the connector is the same shape as
materialize-s3-csv with the writer and file extension swapped. Object and array
fields are written as nested JSON rather than encoded strings.

The one format option exposed is `skipNulls`, which omits null-valued fields
instead of writing them as null. It maps to `writer.WithJsonSkipNulls`, which
had no test coverage, so `TestJsonWriterSkipNulls` is added alongside the
existing writer tests.

No CHANGELOG entry: the connector is new, so there is no existing behaviour to
describe a change to.
@strix-security

strix-security Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Strix Security Review

No security issues found.

Updated for bd86dcc.


Reviewed by Strix
Re-run review · Configure security review settings

@estuary-docs-previews

Copy link
Copy Markdown

Docs preview: https://connectors-pr-5253-estuary-docs.mike-39e.workers.dev

Changed pages:

Rebuilt on every push, and the link stays the same.
Not a deploy: production is untouched until this merges.

@williamhbaker williamhbaker left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1 @@
v1 No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you add a trailing EOL.

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.

3 participants