vectordotdev/vector · error · nom::Err::Error

Tag

Error message

Tag

What it means

The ClickHouse Arrow type parser (nom-based) fails with `ErrorKind::Tag` when parsing a ClickHouse type string: the `ch_type` parser's fallthrough arm matches no known type prefix, so nom reports a Tag mismatch at the remaining input.

Solutions

  1. Check which ClickHouse type string failed and whether the parser supports it; upgrade Vector for newer type support.
  2. Switch the sink transport from native/Arrow to HTTP (JSON) which doesn't use this parser.
  3. Alter the table column to a supported type (e.g. standard numeric/string types).
  4. Report/patch the missing type in src/sinks/clickhouse/arrow/parser.rs.

Example fix

// parser fallthrough (for contributors)
// before
_ => Err(nom::Err::Error(Error::new(input, ErrorKind::Tag))),

// after — add the missing arm first
"Nullable" => parse_nullable(input),
_ => Err(nom::Err::Error(Error::new(input, ErrorKind::Tag))),
Defensive patterns

Strategy: fallback

Validate before calling

// validate table column types against supported set before using native transport
let unsupported: Vec<_> = columns.iter()
    .filter(|c| !SUPPORTED_CH_TYPES.iter().any(|s| c.r#type.starts_with(s)))
    .collect();

Try / catch

match parse_result {
    Err(nom::Err::Error(e)) if e.code == ErrorKind::Tag => { /* fall back to HTTP transport or skip column */ }
    other => other?,
}

Prevention

When it happens

Trigger: Querying a ClickHouse column whose type string is not in the parser's supported list (exotic/nested types, new ClickHouse versions, parameterized types the parser doesn't recognize).

Common situations: Sink/schema discovery against a ClickHouse server using newer or uncommon column types (e.g. unsupported Map/JSON variants), causing native (Arrow) transport schema parsing to fail.

Related errors


AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16). Data as JSON: /api/errors/46f0de36150432a2. Report an issue: GitHub.

Appendix: source

Thrown at src/sinks/clickhouse/arrow/parser.rs:285

            .map(|scale| ClickHouseType::Decimal {
                precision: DECIMAL64_PRECISION,
                scale,
            })
            .parse(rest),
        "Decimal128" => parens(parse_i8)
            .map(|scale| ClickHouseType::Decimal {
                precision: DECIMAL128_PRECISION,
                scale,
            })
            .parse(rest),
        "Decimal256" => parens(parse_i8)
            .map(|scale| ClickHouseType::Decimal {
                precision: DECIMAL256_PRECISION,
                scale,
            })
            .parse(rest),

        _ => Err(nom::Err::Error(Error::new(input, ErrorKind::Tag))),
    }
}

impl FromStr for ClickHouseType {
    type Err = String;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        all_consuming(ch_type)
            .parse(s)
            .map(|(_, parsed)| parsed)
            .map_err(|e| format!("Failed to parse ClickHouse type '{s}': {e}"))
    }
}

#[cfg(test)]
mod tests {
    use super::*;

View on GitHub (pinned to bdb87aeaa4)