{"record":{"id":"6766670e6401a64e","repo":"cube-js/cube","slug":"unexpected-value","errorCode":null,"errorMessage":"Unexpected value: {:?}","messagePattern":"Unexpected value: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/store/mod.rs","lineNumber":148,"sourceCode":"        let schema = Arc::new(Schema::new(\n            columns\n                .iter()\n                .map(|c| c.clone().into())\n                .collect::<Vec<Field>>(),\n        ));\n\n        let mut column_values: Vec<Arc<dyn Array>> = Vec::with_capacity(schema.fields().len());\n\n        for c in columns.iter() {\n            match c.get_column_type() {\n                ColumnType::String => {\n                    let mut column = StringBuilder::new();\n                    for i in 0..self.data.len() {\n                        let value = &self.data[i].values()[c.get_index()];\n                        if let TableValue::String(v) = value {\n                            column.append_value(v.as_str());\n                        } else {\n                            panic!(\"Unexpected value: {:?}\", value);\n                        }\n                    }\n                    column_values.push(Arc::new(column.finish()));\n                }\n                ColumnType::Int => {\n                    let mut column = Int64Builder::new();\n                    for i in 0..self.data.len() {\n                        let value = &self.data[i].values()[c.get_index()];\n                        if let TableValue::Int(v) = value {\n                            column.append_value(*v);\n                        } else {\n                            panic!(\"Unexpected value: {:?}\", value);\n                        }\n                    }\n                    column_values.push(Arc::new(column.finish()));\n                }\n                _ => unimplemented!(),\n            }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/store/mod.rs#L130-L166","documentation":"In to_execution_plan, when converting in-memory table data to Arrow columns, a String-typed column must contain only TableValue::String values; any other TableValue variant triggers this panic. It is a type-invariant check that column data matches its declared schema.","triggerScenarios":"to_execution_plan building an Arrow StringBuilder for a column declared String while some row holds a non-String TableValue (e.g. Int, Null variant) at that column index.","commonSituations":"Internal schema/data mismatch, e.g. after a metadata corruption or a bug where a table was created with one schema and filled with values of another; not reachable through normal user APIs.","solutions":["Upgrade CubeStore to the latest version","Recreate the affected table / re-ingest the data so schema and values agree","Verify the table's schema in the metastore matches the data files and file a bug with details if not"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// not catchable in-process; supervise the process and recreate the table after failure\nif crash log matches 'Unexpected value' in store/mod.rs to_execution_plan: stop serving, dump table schema from metastore, drop & re-ingest table, restart.","preventionTips":["Never hand-edit metastore or chunk data files","Keep writer and reader CubeStore versions identical","Re-ingest data rather than patching values in place","Watch for schema-migration bugs and test upgrades on staging data"],"tags":["panic","type-mismatch","internal-bug","arrow"],"backgroundTag":"schema-type-mismatch","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}