vitessio/vitess · error

err

Error message

err

What it means

addColumn panics with the raw error when evalengine.Translate fails to translate a rewritten projection expression for the hash join's output columns. Unlike filter planning there is no special-casing here: any translation failure (unsupported expression, bad AST shape, environment/collation problem) bubbles up as an internal panic.

Source

Thrown at go/vt/vtgate/planbuilder/operators/hash_join.go:349

		}

		if rOffset := check(rId, hj.RHS, rhsOffset); rOffset >= 0 {
			r.replaceExpr = sqlparser.NewOffset(rOffset, expr)
			return false
		}

		return true
	}

	rewrittenExpr := sqlparser.CopyOnRewrite(in, pre, r.post, ctx.SemTable.CopySemanticInfo).(sqlparser.Expr)
	cfg := &evalengine.Config{
		ResolveType: ctx.TypeForExpr,
		Collation:   ctx.SemTable.Collation,
		Environment: ctx.VSchema.Environment(),
	}
	eexpr, err := evalengine.Translate(rewrittenExpr, cfg)
	if err != nil {
		panic(err)
	}

	_, isPureOffset := rewrittenExpr.(*sqlparser.Offset)

	return &ProjExpr{
		Original: aeWrap(in),
		EvalExpr: rewrittenExpr,
		ColExpr:  rewrittenExpr,
		Info:     &EvalEngine{EExpr: eexpr},
	}, isPureOffset
}

// JoinPredicate produces an AST representation of the join condition this join has
func (hj *HashJoin) JoinPredicate() sqlparser.Expr {
	exprs := slice.Map(hj.JoinComparisons, func(from Comparison) sqlparser.Expr {
		return &sqlparser.ComparisonExpr{
			Left:  from.LHS,
			Right: from.RHS,

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Identify the offending SELECT expression from the query and replace it with a supported equivalent or compute it client-side
  2. Simplify the projection (select base columns, transform in application code)
  3. Reproduce minimally and file a Vitess bug with the query and panic stack
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate projection expressions in tooling
if _, err := evalengine.Translate(expr, cfg); err != nil { /* simplify SELECT list before planning */ }

Try / catch

defer func() {
	if r := recover(); r != nil {
		err = vterrors.Errorf(vtrpcpb.Code_INTERNAL, "hash join column planning failed: %v", r)
	}
}()

Prevention

When it happens

Trigger: A projection expression on a hash join, after rewriting to offsets (rewrittenExpr), contains something evalengine.Translate rejects - unsupported functions, unexpected Offset/expression combinations, or invalid collation context - reached via the anonymous caller of addColumn.

Common situations: SELECT lists over hash joins containing functions or expressions the evalengine cannot translate; collation misconfigurations; planner bugs where offset rewriting produced an untranslatable tree.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/d0aa1df859f1ea29. Report an issue: GitHub.