{"record":{"id":"078605c3f6e9dd8a","repo":"cube-js/cube","slug":"unsupported-data-type","errorCode":null,"errorMessage":"Unsupported data type: {:?}","messagePattern":"Unsupported data type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubesql/cubesql/src/sql/dataframe.rs","lineNumber":591,"sourceCode":"                    }\n                }\n                DataType::List(_) => {\n                    let a = array.as_any().downcast_ref::<ListArray>().unwrap();\n\n                    for i in 0..num_rows {\n                        rows[i].push(if a.is_null(i) {\n                            TableValue::Null\n                        } else {\n                            TableValue::List(ListValue::new(a.value(i)))\n                        });\n                    }\n                }\n                DataType::Null => {\n                    for i in 0..num_rows {\n                        rows[i].push(TableValue::Null)\n                    }\n                }\n                x => panic!(\"Unsupported data type: {:?}\", x),\n            }\n        }\n        all_rows.append(&mut rows);\n    }\n\n    Ok(DataFrame::new(cols, all_rows))\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n\n    #[test]\n    fn test_dataframe_print() {\n        let frame = DataFrame::new(\n            vec![Column::new(\n                \"test\".to_string(),\n                ColumnType::String,","sourceCodeStart":573,"sourceCodeEnd":609,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubesql/cubesql/src/sql/dataframe.rs#L573-L609","documentation":"batches_to_dataframe converts Arrow RecordBatches into CubeSQL's internal DataFrame. Any column whose Arrow DataType has no mapping to a TableValue variant (anything beyond the supported set, where DataType::Null and other known types are handled explicitly) hits the catch-all `x => panic!(\"Unsupported data type: {:?}\")`.","triggerScenarios":"A query result stream from the data source produces an Arrow column type not covered by the conversion (e.g. Decimal128, List, Struct, Dictionary, Map) and is converted via batches_to_dataframe.","commonSituations":"Querying a column of an exotic DB type (DECIMAL with high precision, arrays, JSON) through the SQL interface; driver version changes producing new Arrow types.","solutions":["Cast the offending column to a supported type in the query (e.g. CAST(col AS VARCHAR) or to DOUBLE)","Identify the type from the panic payload's Debug output and add a mapping arm in batches_to_dataframe","Pre-aggregate or reshape the column upstream so only primitives reach CubeSQL"],"exampleFix":"// before\nSELECT prices FROM trades\n// after\nSELECT CAST(prices AS DOUBLE) AS prices FROM trades","handlingStrategy":"type-guard","validationCode":"fn is_supported_arrow_type(dt: &arrow::datatypes::DataType) -> bool {\n    use arrow::datatypes::DataType::*;\n    matches!(\n        dt,\n        Null | Int8 | Int16 | Int32 | Int64 | UInt8 | UInt16 | UInt32 | UInt64\n            | Float32 | Float64 | Utf8 | LargeUtf8 | Boolean\n            | Timestamp(_, _)\n    )\n}\n// check each batch column before conversion\nfor f in batch.schema().fields() {\n    assert!(is_supported_arrow_type(f.data_type()), \"unsupported: {:?}\", f.data_type());\n}","typeGuard":"fn is_supported_arrow_type(dt: &arrow::datatypes::DataType) -> bool {\n    use arrow::datatypes::DataType::*;\n    matches!(dt, Null | Int8 | Int16 | Int32 | Int64 | Float32 | Float64 | Utf8 | Boolean | Timestamp(_, _))\n}","tryCatchPattern":null,"preventionTips":["Cast exotic column types (DECIMAL, LIST, STRUCT, JSON) to primitives in queries","Keep driver and CubeSQL versions aligned so Arrow type mappings match","Log batch schemas in staging before enabling new sources"],"tags":["rust","arrow","dataframe","type-mapping","panic"],"backgroundTag":"unsupported-data-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}