{"record":{"id":"1aae8a79175b44d4","repo":"influxdata/influxdb","slug":"specified-column-name-column-name-does-not-exist-in-the","errorCode":null,"errorMessage":"specified column (name: {column_name}) does not exist in the table definition","messagePattern":"specified column \\(name: (.+?)\\) does not exist in the table definition","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_cache/src/last_cache/mod.rs","lineNumber":22,"sourceCode":"\nmod cache;\npub use cache::CreateLastCacheArgs;\nmod metrics;\nmod provider;\npub use provider::{LastCacheProvider, background_catalog_update};\nmod table_function;\nuse schema::InfluxColumnType;\npub use table_function::{LAST_CACHE_UDTF_NAME, LastCacheFunction};\n\n#[derive(Debug, thiserror::Error)]\npub enum Error {\n    #[error(\"invalid cache size\")]\n    InvalidCacheSize,\n    #[error(\n        \"last cache already exists for database and table, but it was configured differently: {reason}\"\n    )]\n    CacheAlreadyExists { reason: String },\n    #[error(\"specified column (name: {column_name}) does not exist in the table definition\")]\n    ColumnDoesNotExistByName { column_name: String },\n    #[error(\"specified column (id: {column_id}) does not exist in the table definition\")]\n    ColumnDoesNotExistById { column_id: ColumnId },\n    #[error(\"specified key column (id: {column_id}) does not exist in the table schema\")]\n    KeyColumnDoesNotExist { column_id: ColumnId },\n    #[error(\"specified key column (name: {column_name}) does not exist in the table schema\")]\n    KeyColumnDoesNotExistByName { column_name: String },\n    #[error(\"key column must be string, int, uint, or bool types, got: {column_type}\")]\n    InvalidKeyColumn { column_type: InfluxColumnType },\n    #[error(\"specified value column ({column_id}) does not exist in the table schema\")]\n    ValueColumnDoesNotExist { column_id: ColumnId },\n    #[error(\"requested last cache does not exist\")]\n    CacheDoesNotExist,\n}\n\nimpl Error {\n    fn cache_already_exists(reason: impl Into<String>) -> Self {\n        Self::CacheAlreadyExists {","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_cache/src/last_cache/mod.rs#L4-L40","documentation":"Error::ColumnDoesNotExistByName is thrown when a last cache operation references a column by name that is not present in the table's schema. Last cache configuration (key columns, value columns) must reference columns that exist in the table definition, and the library validates column names against the schema before building the cache. The offending name is reported via the column_name field.","triggerScenarios":"Calling create_last_cache or cache update APIs with a key_column_names or value_columns entry that doesn't exist in the table; SQL CREATE Last CACHE naming a misspelled or renamed column; referencing a column before the schema was updated to include it.","commonSituations":"Typos or case-mismatch in column names; schema changed (column dropped/renamed) while cache config was not updated; provisioning scripts written against a different schema version; columns added later than the cache creation.","solutions":["Verify the column name against the table schema (case-sensitive) and fix the typo","Fetch the current table schema and validate all configured column names before creating/updating the cache","If the column was renamed or dropped, update the cache configuration to the new schema","Ensure schema migrations run before cache creation so referenced columns exist"],"exampleFix":"// before\nlet cfg = LastCacheConfiguration::new(vec![\"tags_user_id\".into()], &schema)?; // typo\n// after\nlet col = \"user_id\";\nschema\n    .column(col)\n    .ok_or_else(|| format!(\"column {col} not in table schema\"))?;\nlet cfg = LastCacheConfiguration::new(vec![col.into()], &schema)?;","handlingStrategy":"validation","validationCode":"// validate all configured columns against the table schema first\nfor col in &cache_columns {\n    schema\n        .column(col)\n        .ok_or_else(|| format!(\"column '{col}' does not exist in table '{}' schema\", table_name))?;\n}","typeGuard":null,"tryCatchPattern":"match provider.create_last_cache(db, table, cfg) {\n    Err(Error::ColumnDoesNotExistByName { column_name }) => {\n        eprintln!(\"fix column name '{column_name}' in cache config\");\n    }\n    r => r?,\n}","preventionTips":["Generate cache column lists from the live schema instead of hardcoding names","Run schema migrations before cache provisioning","Match column names case-exactly and lint cache configs against schema in CI"],"tags":["schema","column","validation","last-cache"],"backgroundTag":"schema-validation-failed","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"}