{"record":{"id":"e3ca4afc3c6c2230","repo":"cube-js/cube","slug":"unsupported-value","errorCode":null,"errorMessage":"Unsupported value: {:?}","messagePattern":"Unsupported value: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rust/cubestore/cubestore/src/streaming/mod.rs","lineNumber":1002,"sourceCode":"                            if id.value == col && op == binary_op {\n                                if let Expr::Value(v) = right.as_ref() {\n                                    value = Some(v);\n                                }\n                            }\n                        }\n                        if let Expr::Identifier(id) = right.as_ref() {\n                            if id.value == col && op == binary_op {\n                                if let Expr::Value(v) = left.as_ref() {\n                                    value = Some(v);\n                                }\n                            }\n                        }\n                        if let Some(v) = value {\n                            Some(match v {\n                                Value::SingleQuotedString(s) => s.to_string(),\n                                Value::DoubleQuotedString(s) => s.to_string(),\n                                Value::Number(s, _) => s.to_string(),\n                                x => panic!(\"Unsupported value: {:?}\", x),\n                            })\n                        } else {\n                            if op == &BinaryOperator::And || op == &BinaryOperator::Or {\n                                if let Some(res) = find_filter(left, col, binary_op) {\n                                    return Some(res);\n                                }\n                                if let Some(res) = find_filter(right, col, binary_op) {\n                                    return Some(res);\n                                }\n                            }\n                            None\n                        }\n                    }\n                    Expr::Nested(e) => find_filter(&e, col, binary_op),\n                    _ => None,\n                }\n            }\n","sourceCodeStart":984,"sourceCodeEnd":1020,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cubestore/cubestore/src/streaming/mod.rs#L984-L1020","documentation":"find_filter translates SQL filter expressions (from parsed sqlparser AST) into internal filters while handling post_req requests. It supports string literals (single/double quoted) and numbers as comparison values; any other SQL literal shape (e.g. booleans, NULL, function calls, arrays) hits a panic with 'Unsupported value'.","triggerScenarios":"Issuing a streaming/SQL API request whose WHERE clause compares a column against an unsupported literal type — e.g. WHERE col = true, WHERE col IS NULL in a filter position, or a function/expression value — routed through find_filter via post_req.","commonSituations":"BI tools or SQL clients generating predicates with boolean or NULL literals against CubeStore streaming endpoints; queries copied from Postgres that rely on richer literal semantics.","solutions":["Rewrite the filter to compare against a quoted string or numeric literal","Replace boolean literals with equivalent string/number comparisons where supported","Move unsupported predicates (NULL checks, function results) out of the filtered request or handle client-side","Upgrade CubeStore in case newer versions support the literal type"],"exampleFix":"// before\nSELECT * FROM tbl WHERE flag = true\n// after\nSELECT * FROM tbl WHERE flag = 'true'","handlingStrategy":"try-catch","validationCode":"// client-side: reject filters with unsupported literal types before sending\nfunction validateFilter(expr) {\n  const unsupported = [/=\\s*true\\b/i, /=\\s*false\\b/i, /IS\\s+NULL/i, /=\\s*[A-Za-z_]+\\s*\\(/];\n  if (unsupported.some(r => r.test(expr))) throw new Error('Unsupported literal in filter: use string or number literals');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await client.post(req);\n} catch (e) {\n  if (String(e.cause).includes('Unsupported value')) {\n    // rewrite query with supported literals or handle filtering client-side\n  } else throw e;\n}","preventionTips":["Restrict WHERE clauses to string/number literal comparisons on streaming endpoints","Sanitize BI-tool-generated SQL before sending","Handle NULL/boolean predicates client-side","Test queries from all SQL clients against CubeStore before enabling them in production"],"tags":["sql","filter","panic","unsupported-literal"],"backgroundTag":"unsupported-sql-literal","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}