{"record":{"id":"1a59746dba18bf7f","repo":"cube-js/cube","slug":"unexpected-dimension-type","errorCode":null,"errorMessage":"Unexpected dimension type: {}","messagePattern":"Unexpected dimension type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/transport/ext.rs","lineNumber":404,"sourceCode":"        if let Some(_) = self\n            .measures\n            .iter()\n            .find(|m| m.name.eq_ignore_ascii_case(member_name))\n        {\n            return Some(MemberType::Number);\n        }\n\n        if let Some(dimension) = self\n            .dimensions\n            .iter()\n            .find(|m| m.name.eq_ignore_ascii_case(member_name))\n        {\n            return Some(match dimension.r#type.as_str() {\n                \"number\" => MemberType::Number,\n                \"boolean\" => MemberType::Boolean,\n                \"string\" => MemberType::String,\n                \"time\" => MemberType::Time,\n                x => panic!(\"Unexpected dimension type: {}\", x),\n            });\n        }\n\n        if let Some(_) = self\n            .segments\n            .iter()\n            .find(|m| m.name.eq_ignore_ascii_case(member_name))\n        {\n            return Some(MemberType::Boolean);\n        }\n        None\n    }\n}\n\npub fn df_data_type_by_column_type(column_type: ColumnType) -> DataType {\n    match column_type {\n        ColumnType::Int32 | ColumnType::Int64 | ColumnType::Int8 => DataType::Int64,\n        ColumnType::String => DataType::Utf8,","sourceCodeStart":386,"sourceCodeEnd":422,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/transport/ext.rs#L386-L422","documentation":"member_type maps a Cube dimension's declared type to the internal MemberType enum. Only number, boolean, string and time are recognized; any other `type` value in the dimension metadata causes a panic.","triggerScenarios":"A data model schema declares a dimension with a type string outside {number, boolean, string, time} (e.g. 'geo', 'bigint', a typo like 'strng') and a meta/transport request calls member_type for that dimension.","commonSituations":"Hand-written or AI-generated data model files with invalid dimension types; schema from a newer/older Cube version exposing a type this CubeSQL build doesn't know.","solutions":["Fix the dimension's type in the data model to one of: number, boolean, string, time","Move the value to a measure or remove the dimension if it isn't one of the supported types","Upgrade CubeSQL/Cube so both sides agree on the supported type vocabulary"],"exampleFix":"// before (data model)\ndimensions:\n  - name: location\n    sql: ${TABLE}.location\n    type: geo\n// after\ndimensions:\n  - name: location\n    sql: ${TABLE}.location\n    type: string","handlingStrategy":"validation","validationCode":"const SUPPORTED_DIM_TYPES: [&str; 4] = [\"number\", \"boolean\", \"string\", \"time\"];\nfn validate_schema(schema: &serde_json::Value) -> Result<(), String> {\n    for dim in schema[\"dimensions\"].as_array().unwrap_or(&vec![]) {\n        let t = dim[\"type\"].as_str().unwrap_or(\"\");\n        if !SUPPORTED_DIM_TYPES.contains(&t) {\n            return Err(format!(\"dimension '{}' has unsupported type '{}'\", dim[\"name\"], t));\n        }\n    }\n    Ok(())\n}","typeGuard":"fn is_supported_dim_type(t: &str) -> bool {\n    matches!(t, \"number\" | \"boolean\" | \"string\" | \"time\")\n}","tryCatchPattern":null,"preventionTips":["Validate data model files against the supported type list at CI time","Avoid typos by copying type names from the Cube docs","Keep Cube and CubeSQL versions in sync for new dimension types"],"tags":["rust","schema","dimensions","panic"],"backgroundTag":"unsupported-member-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}