{"record":{"id":"59527666d0d67869","repo":"vitessio/vitess","slug":"unimplemented","errorCode":"UNIMPLEMENTED","errorMessage":"%s: %s (evalengine.ErrTranslateExprNotSupported, sqlparser.String(predicate))","messagePattern":"(.+?): (.+?) \\(evalengine\\.ErrTranslateExprNotSupported, sqlparser\\.String\\(predicate\\)\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"go/vt/vtgate/planbuilder/operators/filter.go","lineNumber":115,"sourceCode":"}\n\nfunc (f *Filter) GetOrdering(ctx *plancontext.PlanningContext) []OrderBy {\n\treturn f.Source.GetOrdering(ctx)\n}\n\nfunc (f *Filter) planOffsets(ctx *plancontext.PlanningContext) Operator {\n\tcfg := &evalengine.Config{\n\t\tResolveType: ctx.TypeForExpr,\n\t\tCollation:   ctx.SemTable.Collation,\n\t\tEnvironment: ctx.VSchema.Environment(),\n\t}\n\n\tpredicate := sqlparser.AndExpressions(f.Predicates...)\n\trewritten := useOffsets(ctx, predicate, f)\n\teexpr, err := evalengine.Translate(rewritten, cfg)\n\tif err != nil {\n\t\tif strings.HasPrefix(err.Error(), evalengine.ErrTranslateExprNotSupported) {\n\t\t\tpanic(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, \"%s: %s\", evalengine.ErrTranslateExprNotSupported, sqlparser.String(predicate)))\n\t\t}\n\t\tpanic(err)\n\t}\n\n\tf.PredicateWithOffsets = eexpr\n\treturn nil\n}\n\nfunc (f *Filter) ShortDescription() string {\n\treturn sqlparser.String(sqlparser.AndExpressions(f.Predicates...))\n}\n\nfunc (f *Filter) setTruncateColumnCount(offset int) {\n\tf.ResultColumns = offset\n}\n\nfunc (f *Filter) getTruncateColumnCount() int {\n\treturn f.ResultColumns","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/vitessio/vitess/blob/01a25a7d176f94613b8d59d799f438380a8760e4/go/vt/vtgate/planbuilder/operators/filter.go#L97-L133","documentation":"When planning a filter's predicates with offsets (useOffsets + evalengine.Translate), an error whose message starts with evalengine.ErrTranslateExprNotSupported is converted into a gRPC UNIMPLEMENTED error. It means the filter predicate contains an expression the evalengine translator cannot represent after offset rewriting (unsupported function, construct, or type in the WHERE/HAVING predicate).","triggerScenarios":"A query's filter predicate, after being rewritten to offset-based expressions for hash-join/filter planning, contains an unsupported construct - e.g. an unsupported function call, subquery remnant, or comparison the evalengine does not translate - triggering the prefix check in planOffsets.","commonSituations":"Queries using MySQL functions not yet supported by Vitess's evalengine; version upgrades where offset-based filter planning newly touches a predicate; ORMs emitting unusual expressions in WHERE clauses on joins that require offset planning.","solutions":["Read the original predicate in the error message and identify the unsupported expression; rewrite the query to avoid it or compute it outside SQL","Move the unsupported computation out of the filtered predicate (e.g. select it, then filter in application code) or simplify it into supported functions","Check Vitess release notes/evalengine support list; upgrade to a version where the function is supported, or file a feature request"],"exampleFix":"// before\nSELECT * FROM t1 JOIN t2 ON t1.id = t2.id WHERE MY_CUSTOM_FUNC(t1.x) = 1\n// after\nSELECT * FROM t1 JOIN t2 ON t1.id = t2.id WHERE t1.x = 1 -- or a supported equivalent expression","handlingStrategy":"try-catch","validationCode":"// best-effort pre-check in tooling\n_, err := evalengine.Translate(predicate, cfg)\nif err != nil && strings.HasPrefix(err.Error(), evalengine.ErrTranslateExprNotSupported) { /* rewrite query beforehand */ }","typeGuard":null,"tryCatchPattern":"err := grpcerr.Run(plan) // returns vtrpcpb.Code_UNIMPLEMENTED wrapped error\nif code := vterrors.Code(err); code == vtrpcpb.Code_UNIMPLEMENTED {\n\t// fall back to a simpler query or surface a clear user-facing message\n}","preventionTips":["Keep WHERE predicates to evalengine-supported functions","Test application queries against Vitess with representative predicates","Track evalengine supported-function list per Vitess version before upgrading"],"tags":["vitess","evalengine","unimplemented","expression-translation"],"backgroundTag":"expression-not-supported","analyzedSha":"01a25a7d176f94613b8d59d799f438380a8760e4","analyzedAt":"2026-09-01T17:28:30.605Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}