Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Optimize sink datasets

Full knob taxonomy for sink tuning (correctness, shape, throughput, sampling), recommended config profiles, a sizing playbook, and common anti-patterns.

This guide is the customer-facing reference for shaping the destination dataset so it lands cleanly and stays cheap to query later. It covers the two knob families that decide what the destination looks like: Correctness (which rows land, and how they are reconciled) and Shape (how the dataset is physically laid out).

For knobs that govern how fast and how cheaply the run completes, including file sizing, workers, parallelism, and sampling, see Pipeline optimization. Optimizing for time covers throughput and validation-sampling knobs. Optimizing for resource covers memory/CPU and width-sampling knobs. The hub holds the recommended tuning profiles.

This guide does not cover destination-native maintenance. This includes Iceberg compaction, Snowflake auto-clustering jobs, BigQuery materialized view refreshes, and Redshift VACUUM. Those are scheduled by the destination owner, not by the Nilus pipeline.

When NOT to optimize

For most pipelines, the defaults are correct. Tune only when you see a concrete symptom, not pre-emptively:

  • Repeated runs duplicate rows or fail to refresh → look at incremental_strategy, incremental_key, primary_key (Correctness knobs).

  • Destination table or column names do not match the source (pkey became p_key) → look at SCHEMA_NAMING (Correctness Knobs).

  • Destination is hard to query / scans too much → look at partition_by, cluster_by, max_table_nesting (Shape knobs).

  • Run is slow, runs out of memory, or produces too many small files → that is a throughput/resource concern; see Pipeline optimization.

If the destination is queryable, the data is correct, and your bills are reasonable, leave the configuration alone.

The knob taxonomy

Nilus exposes 20-plus options across source.options, sink.options, and pipeline runtime environment variables. They group into four jobs:

Category
Job
Knobs
Documented in

Correctness

Get the right rows into the destination

incremental_strategy, incremental_key, primary_key, type_hints, interval_start, interval_end, mask, SCHEMA_NAMING

This guide

Shape

Decide how the destination dataset is physically laid out

partition_by, cluster_by, max_table_nesting

This guide

Throughput

Decide how fast and how cheaply the run completes

loader_file_format, loader_file_size, page_size, extract_parallelism, staging_bucket, LOAD__WORKERS, NORMALIZE__WORKERS, LOAD__PARALLELISM_STRATEGY

Sampling

Limit extraction volume for testing, validation, or partial backfills

sql_limit, yield_limit, sql_exclude_columns, sql_reflection_level

This guide documents the Correctness and Shape knobs in detail. Throughput and Sampling are covered by the Optimizing for time and Optimizing for resource guides. Every knob is documented with its placement (source.options / sink.options / env var), default, valid values, and the symptom it solves.

Detailed knob reference

Each knob is documented with its placement (source.options / sink.options / env var), default, valid values, and the symptom it solves.

  • Correctness knobs: get the right rows into the destination: incremental_strategy, incremental_key, primary_key, type_hints, interval_start / interval_end, mask, SCHEMA_NAMING.

  • Shape knobs: lay out the destination dataset: partition_by, cluster_by, max_table_nesting.

  • Tuning large Lakehouse (Iceberg) loads: wide/narrow file sizing and benchmark-backed configs for Iceberg destinations.

For the Throughput knobs (loader_file_size, page_size, extract_parallelism, LOAD__WORKERS, …) and Sampling knobs, plus the recommended tuning profiles and the step-by-step sizing playbook, see Pipeline optimization.

Anti-patterns

  • Using merge without a usable primary_key: the run does not fail. Nilus warns and falls back to append, which duplicates rows. query: never infers a table primary key.

  • Putting optimization options under the wrong section: for example, incremental_strategy under source.options. The stack schema rejects unknown keys in both sink.options and source.options because additionalProperties is false.

  • Adding multiple partition_by rules pre-emptively: partitions cost write-side performance for no read-side benefit until consumers actually filter on them.

  • Raising max_table_nesting on nested payloads without inspecting arrays: the default "0" keeps nested objects as json. Values "1" and "2" flatten objects and can split arrays into extra child tables. See Shape knobs.

  • Switching a table read to query: (or the reverse) on the same Lakehouse dest_table: the two paths write different decimal precision and scale values, plus different _nilus_* columns. Iceberg commits can fail with a scale serialization error or cannot add required column: _nilus_load_id. Use a new dest_table. See Schema evolution.

Last updated

Was this helpful?