{"record":{"id":"40089498c128eb82","repo":"influxdata/influxdb","slug":"only-tag-and-string-columns-are-supported-in-the-distinct","errorCode":null,"errorMessage":"only tag and string columns are supported in the distinct cache","messagePattern":"only tag and string columns are supported in the distinct cache","errorType":"validation","errorClass":"CatalogError","httpStatus":400,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":78,"sourceCode":"    #[error(\"no catalog changes to apply: {details}\")]\n    NoCatalogChange { details: String },\n\n    /// Request is invalid.\n    #[error(\"catalog internal error: {details}\")]\n    Internal { details: String },\n\n    #[error(\n        \"persisted catalog checkpoint sequence {checkpoint_sequence} is ahead of live catalog sequence {live_sequence}\"\n    )]\n    BackupCheckpointAhead {\n        checkpoint_sequence: u64,\n        live_sequence: u64,\n    },\n\n    #[error(\"invalid configuration provided: {message}\")]\n    InvalidConfiguration { message: Box<str> },\n\n    #[error(\"only tag and string columns are supported in the distinct cache\")]\n    InvalidDistinctCacheColumnType,\n\n    #[error(\"only uint64, int64, bool, tag, and string columns are supported in the last cache\")]\n    InvalidLastCacheKeyColumnType,\n\n    #[error(\"plugin trigger is already enabled\")]\n    TriggerAlreadyEnabled,\n\n    #[error(\"plugin trigger is already disabled\")]\n    TriggerAlreadyDisabled,\n\n    #[error(\"invalid column type for column '{column_name}', expected {expected}, got {got}\")]\n    InvalidColumnType {\n        column_name: Arc<str>,\n        expected: InfluxColumnType,\n        got: InfluxColumnType,\n    },\n","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L60-L96","documentation":"CatalogError::InvalidDistinctCacheColumnType is thrown when a distinct-value cache is configured with a column whose type cannot be cached. Only tag and string columns support distinct-value caching; numeric, boolean, and time columns are rejected. This is a static schema check performed when the cache is created.","triggerScenarios":"POST /api/v3/configure/distinct_cache with columns including an int64/uint64/bool/float/timestamp column; CREATE DISTINCT CACHE SQL referencing a numeric field; auto-configured cache picking up a non-tag/string column.","commonSituations":"Assuming all columns are cacheable; schema changed from a string to a numeric type after the cache was defined; generating cache configs programmatically without checking column types.","solutions":["Restrict the cache's columns to tag or string columns in the table","Split the cache: use a last-cache for numeric columns instead","Check ColumnType of each requested column before creating the cache","Drop and recreate the cache with only supported columns"],"exampleFix":"// before\nDistinctCacheCreate { columns: vec![\"value\".into()], .. } // value is float\n// after\nDistinctCacheCreate { columns: vec![\"region\".into(), \"host\".into()], .. }","handlingStrategy":"validation","validationCode":"// Rust: only tag/string columns into a distinct cache\nlet ok = cols.iter().all(|c| matches!(\n    table.column(c).map(|c| c.data_type()),\n    Some(ColumnDataType::Tag | ColumnDataType::String)\n));\nassert!(ok, \"distinct cache columns must be tag or string\");","typeGuard":"fn distinct_cacheable(t: ColumnDataType) -> bool {\n    matches!(t, ColumnDataType::Tag | ColumnDataType::String)\n}","tryCatchPattern":"match db.create_distinct_cache(cfg).await {\n    Err(CatalogError::InvalidDistinctCacheColumnType) => {\n        eprintln!(\"use only tag/string columns, or a last-cache for numerics\");\n    }\n    other => other?,\n}","preventionTips":["Filter cache columns by ColumnDataType before config","Recheck cache definitions after schema type changes","Use last-cache for numeric/bool columns","Generate cache configs from the table schema, not hand-written lists"],"tags":["distinct-cache","column-type","validation"],"backgroundTag":"unsupported-operation","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}