risingwavelabs/risingwave · error · ConnectorError

missing field 'table.name'

Error message

missing field 'table.name'

What it means

When building a MySQL CDC reader whose split spans multiple shards, the code rewrites the `table.name` connector property into a shard-matching regex (`name_[0-9]+`). It errors if the property `table.name` is absent from the connector properties, since the rewrite cannot proceed.

Source

Thrown at src/connector/src/source/cdc/source/reader.rs:94

        let split_id = split.id();

        let mut properties = conn_props.properties.clone();

        let mut citus_server_addr = None;
        // For citus, we need to rewrite the `table.name` to capture sharding tables
        if matches!(T::source_type(), CdcSourceType::Citus)
            && let Some(ref citus_split) = split.citus_split
            && let Some(ref server_addr) = citus_split.server_addr
        {
            citus_server_addr = Some(server_addr.clone());
            let host_addr =
                HostAddr::from_str(server_addr).context("invalid server address for cdc split")?;
            properties.insert("hostname".to_owned(), host_addr.host);
            properties.insert("port".to_owned(), host_addr.port.to_string());
            // rewrite table name with suffix to capture all shards in the split
            let mut table_name = properties
                .remove("table.name")
                .ok_or_else(|| anyhow!("missing field 'table.name'"))?;
            table_name.push_str("_[0-9]+");
            properties.insert("table.name".into(), table_name);
        }

        let source_id = split.split_id() as u64;
        let source_type = conn_props.get_source_type_pb();
        let (tx, mut rx) = mpsc::channel(DEFAULT_CHANNEL_SIZE);

        let jvm = Jvm::get_or_init()?;
        let get_event_stream_request = GetEventStreamRequest {
            source_id,
            source_type: source_type as _,
            start_offset: split.start_offset().clone().unwrap_or_default(),
            properties,
            snapshot_done: split.snapshot_done(),
            is_source_job: conn_props.is_cdc_source_job,
        };

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Add `table.name` to the source's WITH connector options, e.g. `WITH (connector='mysql-cdc', 'table.name'='mydb.mytable', ...)`, and recreate the source.
  2. Fix the key spelling/casing so it is exactly `table.name`.
  3. If the table is not actually sharded, rename it or adjust naming so the shard regex path is not triggered.

Example fix

// before
CREATE SOURCE s WITH (connector='mysql-cdc', 'database.name'='db'); -- missing table.name
// after
CREATE SOURCE s WITH (connector='mysql-cdc', 'database.name'='db', 'table.name'='db.t_[0-9]+');
Defensive patterns

Strategy: validation

Validate before calling

// Before creating a sharded CDC source, verify options contain table.name:
const opts = connProps;
if (!('table.name' in opts)) throw new Error("CDC source requires 'table.name' connector option");

Type guard

fn has_table_name(props: &HashMap<String, String>) -> bool {
    props.contains_key("table.name")
}

Try / catch

match properties.get("table.name") {
    Some(t) => t.clone(),
    None => return Err(anyhow!("missing field 'table.name' in CDC connector properties")),
}

Prevention

When it happens

Trigger: Creating a sharded-table CDC source (e.g. MySQL with `table.name` like `db.t_[0-9]+` triggering the shard path) where the connector properties map lacks `table.name` — e.g. using different property keys, or properties stripped by a proxy/config template.

Common situations: Typo (`tableName` vs `table.name`), missing quoted key in the WITH clause, or the shard-detection heuristics firing (table name contains `_1`, `_2` …) on a non-sharded table whose properties were defined without table.name.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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