For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Shape knobs

Settings that control the physical layout of the destination dataset: partitioning, clustering, and nested-field flattening depth.

These knobs decide how the destination dataset is laid out. They affect downstream query performance, not pipeline runtime.

partition_by (sink)

Goes under
Default
Type

sink.options

unset

array of partition objects

Physical partitioning for query pruning. Most useful on lakehouse-style destinations (Iceberg, DataOS Lakehouse) where consumers filter by date/region/customer.

Each partition object accepts:

Field
Required
Description

column

Yes

Source column to derive the partition from.

type

Yes

One of year, month, day, hour, bucket, identity.

name

Yes

Display name for the partition (used in the destination's metadata catalogue).

index

Yes

Integer position (1-based) for ordering when multiple partitions are defined.

bucket_count

Conditional

Required when type: bucket; ignored otherwise.

Example: single date rule

spec:
  sink:
    address: dataos://lakehouse?purpose=rw
    options:
      dest_table: analytics.transactions_raw
      incremental_strategy: append
      partition_by:
        - column: transaction_date
          type: day
          name: transaction_day
          index: 1

Example: date + bucket rule

Anti-patterns

  • Partition explosion. type: identity on a high-cardinality column (e.g. user_id on a 10M-user table) creates 10M partitions and breaks the destination's metadata catalog. Use type: bucket with a sensible bucket_count instead.

  • Mismatched cardinality between partition and loader_file_size. A type: hour partition on a low-volume table produces thousands of tiny files (one per hour, per loader-file split). Pick a coarser partition (day or month) or accept that small files are the norm for low-volume sources.

  • Adding partitions before confirming the access pattern. Add a partition only when consumers repeatedly filter by that column. Otherwise, the partition adds write-side cost with no read-side benefit.

cluster_by (sink)

Goes under
Default
Type

sink.options

unset

array of strings

Secondary physical organization. Different destinations interpret this differently:

  • Snowflake: maps to CLUSTER BY (...) on the destination table. Snowflake auto-clusters in the background. No DDL action is required. The auto-clustering service uses warehouse credits.

  • BigQuery: maps to clustered-table DDL when the table is created. BigQuery does not re-cluster existing tables in place. Re-clustering after the fact requires a CREATE TABLE AS SELECT rebuild.

  • Databricks: maps to CLUSTER BY (...) when supported by the table format (Delta v3+ liquid clustering).

  • Other warehouses (Redshift / Synapse / MS SQL Server): typically no-op or destination-specific behavior. Check the destination connector page.

Start with one frequently-filtered or join column. Use a second column only if the destination and workload clearly justify it.

max_table_nesting (source)

Goes under
Default
Type

source.options

"0"

string ("0", "1", "2")

Controls how deeply nested objects are flattened into parent columns (MongoDB documents, BSON, JSON-typed SaaS payloads). SQL tables are already flat, so the default is a no-op for them. Raising the value increases flattening. Also accepted as environment variable MAX_TABLE_NESTING.

Value
Meaning

"0"

Nested objects land as one json column on the parent. No __ flattening.

"1"

Flatten one level into parent columns (addr__city). Remaining objects stay json.

"2"

Flatten two levels (addr__city, addr__geo__lat).

Example: Keep nested MongoDB objects as JSON

Example: Flatten one level of nested objects

Last updated

Was this helpful?