risingwavelabs/risingwave · error · SinkError::Config

`compaction.small_files_threshold_mb` must be greater than 0

Error message

`compaction.small_files_threshold_mb` must be greater than 0

What it means

Raised when `small_files_threshold_mb` is Some(0). This compaction option defines the size threshold (MB) below which files are considered small; it must be greater than 0 and is validated in from_btreemap.

Source

Thrown at src/connector/src/sink/iceberg/config.rs:649

            return Err(SinkError::Config(anyhow!(
                "`compaction_interval_sec` must be greater than 0"
            )));
        }

        if config.trigger_snapshot_count == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.trigger_snapshot_count` must be greater than 0"
            )));
        }

        if config.max_snapshots_num_before_compaction == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.max_snapshots_num` must be greater than 0"
            )));
        }

        if config.small_files_threshold_mb == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.small_files_threshold_mb` must be greater than 0"
            )));
        }

        if config.delete_files_count_threshold == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.delete_files_count_threshold` must be greater than 0"
            )));
        }

        if config.target_file_size_mb == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.target_file_size_mb` must be greater than 0"
            )));
        }

        if config.write_parquet_max_row_group_rows == Some(0) {
            return Err(SinkError::Config(anyhow!(

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Set `small_files_threshold_mb` to a positive integer, e.g. 16.
  2. Remove the option to use the default threshold.

Example fix

// before
WITH (connector = 'iceberg', small_files_threshold_mb = 0)
// after
WITH (connector = 'iceberg', small_files_threshold_mb = 16)
Defensive patterns

Strategy: validation

Validate before calling

if (opts.small_files_threshold_mb != null && Number(opts.small_files_threshold_mb) <= 0) {
  throw new Error('`compaction.small_files_threshold_mb` must be greater than 0');
}

Type guard

function isValidOptionalPositive(v) {
  return v == null || (Number.isInteger(v) && v > 0);
}

Try / catch

try {
  await createIcebergSink(opts);
} catch (e) {
  if (String(e).includes('small_files_threshold_mb')) {
    delete opts.small_files_threshold_mb;
    return createIcebergSink(opts);
  }
  throw e;
}

Prevention

When it happens

Trigger: CREATE SINK with `compaction.small_files_threshold_mb = 0` in the WITH options of an Iceberg sink.

Common situations: Zero placeholder in generated configs; users trying to disable small-file compaction by zeroing the threshold; typo where the unit was omitted.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/42ea6836ca4fab7f. Report an issue: GitHub.