Skip to content
cccskills
FreePublished on GitHub

schema-field-selection

Control which fields are included or excluded in materializations using depth modes and field overrides. Use when reducing table width, including nested fields, excluding PII, or optimizing performance. Use when user says "exclude fields", "include nested field", "too many columns", "select specific fields", or "field depth".

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md6.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Field Selection for Materializations

Control which fields are included or excluded in materializations using depth modes and field overrides.

Docs: https://docs.estuary.dev/guides/customize-materialization-fields/

When to Use

  • Reduce table width by excluding unnecessary fields
  • Include deeply nested fields that aren't selected by default
  • Exclude sensitive fields from materializations (note: data still exists in the collection — for true PII protection, use redaction on the writeSchema instead)
  • Override connector's default field recommendations

Procedure

Step 1: Pull the Materialization Spec

flowctl catalog pull-specs --name <materialization-name>

Step 2: Configure Field Selection

Add or modify the fields stanza in the binding:

bindings:
  - source: tenant/your/collection
    resource: { table: your_table }
    fields:
      recommended: true    # Depth mode (see below)
      require:             # Object — explicitly include fields
        deeply/nested/field: {}
        another_field: {}
      exclude:             # Array — explicitly exclude fields
        - sensitive_data
        - debug_info

Note: require is an object (field: {}), exclude is an array (- field).

Note: Each connector marks certain fields as required — typically the root document (flow_document) and the collection-key components, and some connectors require additional fields (e.g., CDC-style materializations that depend on _meta/op). Attempting to exclude a connector-required field returns a LOCATION_REQUIRED / FIELD_REQUIRED constraint and the publish fails. The exact list comes from each connector's Validate response.

Depth Modes

The recommended setting controls how deeply nested fields are automatically selected. UI labels are in parentheses:

ValueUI LabelDescription
0Required OnlySelects only fields the connector marks required (root document + key components, plus any connector-specific required fields)
1Depth 1 (default)Top-level scalar fields
2Depth 2Two levels of nesting
trueUnlimited DepthAll scalar fields at any depth

The boolean recommended: false is also accepted and behaves like 0 in practice, but the explicit numeric values are documented and preferred. Use recommended: 0 with require: to hand-pick a small set of fields.

Step 3: Publish Changes

flowctl catalog publish --source flow.yaml

What happens to the destination on publish

Most field selection changes apply non-destructively, no backfill needed:

  • Adding to require (or raising depth) → connector emits ALTER TABLE ADD COLUMN automatically. Existing data is preserved; historical rows show NULL for the new column unless you also backfill.
  • Adding to exclude (or lowering depth) on a column that already exists → connector drops the NOT NULL constraint, stops writing to that column, and leaves the column and its existing data in place. This is by design: per the schema evolution docs, "the existing column will not be dropped, and will just be ignored by the materialization going forward."

If the endpoint has always_drop_tables_on_backfill enabled (an opt-in feature flag, off by default), this snapshot-preservation behavior is overridden whenever you bump backfill on any binding — the affected table is dropped and recreated from scratch, and excluded columns are gone. If you have the flag enabled and want to keep an old column around, avoid bumping backfill on that binding.

For the standard case (flag not set), an excluded column staying in place is usually the right outcome — downstream queries can keep reading the snapshot value, and you avoid any destructive operation. Just publish:

flowctl catalog publish --source flow.yaml

Removing an excluded column from the destination

The default behavior leaves an excluded column in place. If you specifically need to physically remove it — for PII purging, schema cleanup, or freeing storage — pick one of the options below.

Warning: Each option below alters or destroys data already in the destination. Confirm with the user before any of them, and check whether downstream consumers (BI dashboards, reverse-ETL, replicated tables) reference the column.

Option A — Manually drop the column (preferred for large tables):

-- In your destination, after confirming with the user:
ALTER TABLE your_schema.your_table DROP COLUMN sensitive_data;

Then publish your spec with the field in exclude. The connector keeps writing the remaining columns; nothing else is touched. This is what support typically recommends for large tables where a full rebuild would be expensive.

Option B — Force a full table rebuild via always_drop_tables_on_backfill:

If you need multiple columns dropped at once or want the destination schema to exactly match the current field selection, enable the endpoint feature flag and bump backfill on the binding. The connector will issue a fresh CREATE TABLE honoring only the selected fields.

endpoint:
  connector:
    config:
      # ...other endpoint config...
      advanced:
        feature_flags: always_drop_tables_on_backfill

Caveat: this flag is endpoint-wide. Any binding you bump backfill on while it's enabled will drop+recreate its table. If you only want one binding affected, prefer Option A or do a one-off manual DROP TABLE of that specific table before bumping backfill.

Connectors that always drop+recreate on backfill (no flag or manual drop needed): MongoDB, DynamoDB, Elasticsearch, and both Iceberg variants.

Troubleshooting

Field Not Appearing in Destination

  • Verify the field exists in the collection schema and isn't in exclude
  • Try adding it to require explicitly, or raise the depth mode
  • Field names are case-sensitive; nested fields use / (e.g., _meta/op)

Related Skills

  • schema-custom-types-ddl — Customize column types for included fields
  • schema-projections — Rename fields before materialization
  • schema-field-redaction — Hash or block sensitive fields at capture time (more secure than excluding)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Create an Alpaca capture using flowctl to stream stock trade data into Estuary collections. Use when setting up an Alpaca Market Data source for historical and real-time stock trades. Use when user says "capture Alpaca", "stream stock trades", "Alpaca market data", or "connect Alpaca to Estuary".

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

Create a capture for ANY Estuary connector using dynamic schema discovery. Use when the user wants to capture from a source that doesn't have a dedicated skill (e.g., Kafka, Salesforce, HubSpot, Stripe, S3, GCS, Kinesis, or any of the 148+ connectors). Use when user says "capture from <source>", "stream from <source>", "connect <source> to Estuary", or "set up <source> capture" and no connector-specific skill exists.

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

Create an HTTP Ingest (webhook) capture to receive data via HTTP POST requests. Use when setting up webhooks from GitHub, Shopify, Stripe, or any JSON source. Use when user says "set up webhook capture", "HTTP ingest to Estuary", "receive POST requests to Estuary", or "webhook capture".

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

Create a HubSpot Real-Time capture using flowctl to stream CRM data into Estuary collections. Use when setting up a HubSpot source for contacts, companies, deals, tickets, or other HubSpot resources. Use when user says "capture HubSpot", "stream from HubSpot", "HubSpot CDC", or "connect HubSpot to Estuary".

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

Create a MongoDB CDC capture using flowctl. Use when setting up real-time streaming from MongoDB Atlas, DocumentDB, or self-hosted MongoDB. Use when user says "capture MongoDB", "stream from Mongo", "MongoDB CDC", or "connect MongoDB to Estuary".

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

Create a MySQL CDC capture using flowctl with binlog replication. Use when setting up streaming from MySQL, Amazon RDS MySQL, or Aurora MySQL. Use when user says "capture MySQL", "stream from MySQL", "MySQL CDC", "binlog replication", or "connect MySQL to Estuary".

The English summary is being prepared. Showing the original description.

estuary/agent-skills7Updated Sep 25, 2026

See all skills by estuary

Report a problem with this skill