hasura/graphql-engine · error

not implemented

Error message

not implemented

What it means

The connector's expression converter does not support the `TryCast` relational expression and calls unimplemented!(), which panics during logical-plan conversion.

Source

Thrown at v3/crates/custom-connector/src/query/relational.rs:1021

                left: Box::new(convert_expression_to_logical_expr(left, schema)?),
                op: datafusion::logical_expr::Operator::Modulo,
                right: Box::new(convert_expression_to_logical_expr(right, schema)?),
            },
        )),
        RelationalExpression::Negate { expr } => Ok(datafusion::prelude::Expr::Negative(Box::new(
            convert_expression_to_logical_expr(expr, schema)?,
        ))),

        // Scalar functions
        RelationalExpression::Cast { expr, from_type: _, as_type } => {
            convert_expression_to_logical_expr(expr, schema)?
                .cast_to(&convert_cast_type_to_data_type(as_type), schema)
        }
        RelationalExpression::TryCast {
            expr: _,
            from_type: _,
            as_type: _,
        } => unimplemented!(),
        RelationalExpression::Abs { expr } => {
            Ok(abs(convert_expression_to_logical_expr(expr, schema)?))
        }
        RelationalExpression::BTrim { str, trim_str } => Ok(match trim_str {
            None => btrim(vec![convert_expression_to_logical_expr(str, schema)?]),
            Some(trim_str) => btrim(vec![
                convert_expression_to_logical_expr(str, schema)?,
                convert_expression_to_logical_expr(trim_str, schema)?,
            ]),
        }),
        RelationalExpression::Ceil { expr } => {
            Ok(ceil(convert_expression_to_logical_expr(expr, schema)?))
        }
        RelationalExpression::CharacterLength { str } => Ok(character_length(
            convert_expression_to_logical_expr(str, schema)?,
        )),
        RelationalExpression::Coalesce { exprs } => Ok(coalesce(
            exprs

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Avoid TryCast in queries sent to this connector (use Cast or pre-transform types)
  2. Extend convert_expression_to_logical_expr to handle TryCast (map to datafusion try_cast)
  3. Upgrade the connector crate in case support was added
  4. File/track an issue for TryCast support in the custom-connector example

Example fix

// before
RelationalExpression::TryCast { expr, as_type } => unimplemented!(),
// after
RelationalExpression::TryCast { expr, as_type } => Ok(try_cast(convert_expression_to_logical_expr(expr, schema)?, &convert_cast_type_to_data_type(as_type))),
Defensive patterns

Strategy: fallback

Validate before calling

const usesTryCast = (expr) => JSON.stringify(expr).includes('TryCast');
if (usesTryCast(query)) reject('TryCast unsupported');

Try / catch

Catch panics (catch_unwind) during plan conversion and fall back to not pushing down the expression / return a clear unsupported-feature error.

Prevention

When it happens

Trigger: A ndc query containing a TryCast expression is pushed down to this custom connector, hitting the unimplemented arm in convert_expression_to_logical_expr.

Common situations: Using TryCast in a query/filter against the demo custom connector; schema/type configurations that make the planner emit TryCast; newer client features not yet supported by the example connector.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/9070f0f30f534c38. Report an issue: GitHub.