cube-js/cube · error

Unsupported value: {:?}

Error message

Unsupported value: {:?}

What it means

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'.

Source

Thrown at rust/cubestore/cubestore/src/streaming/mod.rs:1002

                            if id.value == col && op == binary_op {
                                if let Expr::Value(v) = right.as_ref() {
                                    value = Some(v);
                                }
                            }
                        }
                        if let Expr::Identifier(id) = right.as_ref() {
                            if id.value == col && op == binary_op {
                                if let Expr::Value(v) = left.as_ref() {
                                    value = Some(v);
                                }
                            }
                        }
                        if let Some(v) = value {
                            Some(match v {
                                Value::SingleQuotedString(s) => s.to_string(),
                                Value::DoubleQuotedString(s) => s.to_string(),
                                Value::Number(s, _) => s.to_string(),
                                x => panic!("Unsupported value: {:?}", x),
                            })
                        } else {
                            if op == &BinaryOperator::And || op == &BinaryOperator::Or {
                                if let Some(res) = find_filter(left, col, binary_op) {
                                    return Some(res);
                                }
                                if let Some(res) = find_filter(right, col, binary_op) {
                                    return Some(res);
                                }
                            }
                            None
                        }
                    }
                    Expr::Nested(e) => find_filter(&e, col, binary_op),
                    _ => None,
                }
            }

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Rewrite the filter to compare against a quoted string or numeric literal
  2. Replace boolean literals with equivalent string/number comparisons where supported
  3. Move unsupported predicates (NULL checks, function results) out of the filtered request or handle client-side
  4. Upgrade CubeStore in case newer versions support the literal type

Example fix

// before
SELECT * FROM tbl WHERE flag = true
// after
SELECT * FROM tbl WHERE flag = 'true'
Defensive patterns

Strategy: try-catch

Validate before calling

// client-side: reject filters with unsupported literal types before sending
function validateFilter(expr) {
  const unsupported = [/=\s*true\b/i, /=\s*false\b/i, /IS\s+NULL/i, /=\s*[A-Za-z_]+\s*\(/];
  if (unsupported.some(r => r.test(expr))) throw new Error('Unsupported literal in filter: use string or number literals');
}

Try / catch

try {
  await client.post(req);
} catch (e) {
  if (String(e.cause).includes('Unsupported value')) {
    // rewrite query with supported literals or handle filtering client-side
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/e3ca4afc3c6c2230. Report an issue: GitHub.