From 23f1497d98000818467399b932afc3720006a823 Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Thu, 29 Jul 2021 21:32:44 -0700 Subject: [PATCH] coldataext: propagate evalCtx directly for casts This commit removes the reliance on propagating `datumVec` objects to supply the cast function with an eval context. All casts in the datum land have been refactored to use `tree.PerformCast` for simplicity. Note that the eval context is not removed from the `datumVec` because it is used by `CompareDatum` method which is a lot more common (and, thus, would require more plumbing to get rid off). Release note: None --- pkg/col/coldataext/datum_vec.go | 12 - pkg/sql/colexec/colbuilder/execplan.go | 15 +- pkg/sql/colexec/colexecbase/cast.eg.go | 815 ++++++++++++++++-- pkg/sql/colexec/colexecbase/cast_test.go | 4 +- pkg/sql/colexec/colexecbase/cast_tmpl.go | 27 +- pkg/sql/colexec/colexecjoin/mergejoiner.go | 6 +- .../colexec/colexecjoin/mergejoiner_test.go | 2 +- .../execgen/cmd/execgen/cast_gen_util.go | 28 +- .../execgen/cmd/execgen/overloads_base.go | 2 +- pkg/sql/colexec/external_hash_joiner.go | 2 +- pkg/sql/colexec/mergejoiner_test.go | 16 +- pkg/sql/colflow/routers_test.go | 2 + pkg/sql/colflow/stats_test.go | 2 +- 13 files changed, 810 insertions(+), 123 deletions(-) diff --git a/pkg/col/coldataext/datum_vec.go b/pkg/col/coldataext/datum_vec.go index cbd8720a0344..e829f003e6a1 100644 --- a/pkg/col/coldataext/datum_vec.go +++ b/pkg/col/coldataext/datum_vec.go @@ -74,18 +74,6 @@ func (d *Datum) CompareDatum(dVec, other interface{}) int { return d.Datum.Compare(dVec.(*datumVec).evalCtx, maybeUnwrapDatum(other)) } -// Cast returns the result of casting d to the type toType. dVec is the -// datumVec that stores d and is used to supply the eval context. -func (d *Datum) Cast(dVec interface{}, toType *types.T) (tree.Datum, error) { - return PerformCast(dVec, d.Datum, toType) -} - -// PerformCast returns the result of casting d to the type toType. dVec is a -// datumVec that is used to supply the eval context. -func PerformCast(dVec interface{}, d tree.Datum, toType *types.T) (tree.Datum, error) { - return tree.PerformCast(dVec.(*datumVec).evalCtx, d, toType) -} - // Hash returns the hash of the datum as a byte slice. func (d *Datum) Hash(da *rowenc.DatumAlloc) []byte { ed := rowenc.EncDatum{Datum: maybeUnwrapDatum(d)} diff --git a/pkg/sql/colexec/colbuilder/execplan.go b/pkg/sql/colexec/colbuilder/execplan.go index bee3a7853faa..82798ae5976f 100644 --- a/pkg/sql/colexec/colbuilder/execplan.go +++ b/pkg/sql/colexec/colbuilder/execplan.go @@ -1136,7 +1136,7 @@ func NewColOperator( args.DiskQueueCfg, args.FDSemaphore, joinType, inputs[0].Root, inputs[1].Root, leftTypes, rightTypes, core.MergeJoiner.LeftOrdering.Columns, core.MergeJoiner.RightOrdering.Columns, - diskAccount, + diskAccount, evalCtx, ) if err != nil { return r, err @@ -1196,7 +1196,7 @@ func NewColOperator( // We must cast to the expected argument type. castIdx := len(typs) input, err = colexecbase.GetCastOperator( - streamingAllocator, input, int(idx), castIdx, typs[idx], expectedType, + streamingAllocator, input, int(idx), castIdx, typs[idx], expectedType, evalCtx, ) if err != nil { colexecerror.InternalError(errors.AssertionFailedf( @@ -1469,7 +1469,7 @@ func NewColOperator( if !actual.Identical(expected) { castedIdx := len(typesWithCasts) r.Root, err = colexecbase.GetCastOperator( - streamingAllocator, r.Root, i, castedIdx, actual, expected, + streamingAllocator, r.Root, i, castedIdx, actual, expected, evalCtx, ) if err != nil { return r, errors.AssertionFailedf("unexpectedly couldn't plan a cast although IsCastSupported returned true: %v", err) @@ -1953,9 +1953,10 @@ func planCastOperator( fromType *types.T, toType *types.T, factory coldata.ColumnFactory, + evalCtx *tree.EvalContext, ) (op colexecop.Operator, resultIdx int, typs []*types.T, err error) { outputIdx := len(columnTypes) - op, err = colexecbase.GetCastOperator(colmem.NewAllocator(ctx, acc, factory), input, inputIdx, outputIdx, fromType, toType) + op, err = colexecbase.GetCastOperator(colmem.NewAllocator(ctx, acc, factory), input, inputIdx, outputIdx, fromType, toType, evalCtx) typs = appendOneType(columnTypes, toType) return op, outputIdx, typs, err } @@ -2017,7 +2018,7 @@ func planProjectionOperators( if err != nil { return nil, 0, nil, err } - op, resultIdx, typs, err = planCastOperator(ctx, acc, typs, op, resultIdx, expr.ResolvedType(), t.ResolvedType(), factory) + op, resultIdx, typs, err = planCastOperator(ctx, acc, typs, op, resultIdx, expr.ResolvedType(), t.ResolvedType(), factory, evalCtx) return op, resultIdx, typs, err case *tree.FuncExpr: var inputCols []int @@ -2158,7 +2159,7 @@ func planProjectionOperators( // is given). In such case, we need to plan a cast. fromType, toType := typs[thenIdxs[i]], typs[caseOutputIdx] caseOps[i], thenIdxs[i], typs, err = planCastOperator( - ctx, acc, typs, caseOps[i], thenIdxs[i], fromType, toType, factory, + ctx, acc, typs, caseOps[i], thenIdxs[i], fromType, toType, factory, evalCtx, ) if err != nil { return nil, resultIdx, typs, err @@ -2184,7 +2185,7 @@ func planProjectionOperators( elseIdx := thenIdxs[len(t.Whens)] fromType, toType := typs[elseIdx], typs[caseOutputIdx] elseOp, thenIdxs[len(t.Whens)], typs, err = planCastOperator( - ctx, acc, typs, elseOp, elseIdx, fromType, toType, factory, + ctx, acc, typs, elseOp, elseIdx, fromType, toType, factory, evalCtx, ) if err != nil { return nil, resultIdx, typs, err diff --git a/pkg/sql/colexec/colexecbase/cast.eg.go b/pkg/sql/colexec/colexecbase/cast.eg.go index 4ea2c3eb60b7..df955a8e68c6 100644 --- a/pkg/sql/colexec/colexecbase/cast.eg.go +++ b/pkg/sql/colexec/colexecbase/cast.eg.go @@ -75,6 +75,7 @@ func GetCastOperator( resultIdx int, fromType *types.T, toType *types.T, + evalCtx *tree.EvalContext, ) (colexecop.Operator, error) { input = colexecutils.NewVectorTypeEnforcer(allocator, input, toType, resultIdx) base := castOpBase{ @@ -82,6 +83,7 @@ func GetCastOperator( allocator: allocator, colIdx: colIdx, outputIdx: resultIdx, + evalCtx: evalCtx, } if fromType.Family() == types.UnknownFamily { return &castOpNullAny{castOpBase: base}, nil @@ -816,6 +818,7 @@ type castOpBase struct { allocator *colmem.Allocator colIdx int outputIdx int + evalCtx *tree.EvalContext } func (c *castOpBase) Reset(ctx context.Context) { @@ -943,12 +946,13 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { if inputVec.Nulls().MaybeHasNulls() { for scratchIdx, outputIdx := range sel[:n] { { + var evalCtx *tree.EvalContext = c.evalCtx converted := scratch[scratchIdx] if true && converted == tree.DNull { outputNulls.SetNull(outputIdx) continue } - res, err := coldataext.PerformCast(outputCol, converted, toType) + res, err := tree.PerformCast(evalCtx, converted, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -958,12 +962,13 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { } else { for scratchIdx, outputIdx := range sel[:n] { { + var evalCtx *tree.EvalContext = c.evalCtx converted := scratch[scratchIdx] if false && converted == tree.DNull { outputNulls.SetNull(outputIdx) continue } - res, err := coldataext.PerformCast(outputCol, converted, toType) + res, err := tree.PerformCast(evalCtx, converted, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -977,8 +982,9 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { for idx := 0; idx < n; idx++ { { var ( - scratchIdx int = idx - outputIdx int = idx + scratchIdx int = idx + outputIdx int = idx + evalCtx *tree.EvalContext = c.evalCtx ) //gcassert:bce converted := scratch[scratchIdx] @@ -986,7 +992,7 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { outputNulls.SetNull(outputIdx) continue } - res, err := coldataext.PerformCast(outputCol, converted, toType) + res, err := tree.PerformCast(evalCtx, converted, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -997,8 +1003,9 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { for idx := 0; idx < n; idx++ { { var ( - scratchIdx int = idx - outputIdx int = idx + scratchIdx int = idx + outputIdx int = idx + evalCtx *tree.EvalContext = c.evalCtx ) //gcassert:bce converted := scratch[scratchIdx] @@ -1006,7 +1013,7 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { outputNulls.SetNull(outputIdx) continue } - res, err := coldataext.PerformCast(outputCol, converted, toType) + res, err := tree.PerformCast(evalCtx, converted, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -1054,6 +1061,9 @@ func (c *castBoolFloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1073,6 +1083,9 @@ func (c *castBoolFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1101,6 +1114,9 @@ func (c *castBoolFloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1120,6 +1136,9 @@ func (c *castBoolFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1178,6 +1197,9 @@ func (c *castBoolInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1197,6 +1219,9 @@ func (c *castBoolInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1225,6 +1250,9 @@ func (c *castBoolInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1244,6 +1272,9 @@ func (c *castBoolInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1302,6 +1333,9 @@ func (c *castBoolInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1321,6 +1355,9 @@ func (c *castBoolInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1349,6 +1386,9 @@ func (c *castBoolInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1368,6 +1408,9 @@ func (c *castBoolInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1426,6 +1469,9 @@ func (c *castBoolIntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1445,6 +1491,9 @@ func (c *castBoolIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1473,6 +1522,9 @@ func (c *castBoolIntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1492,6 +1544,9 @@ func (c *castBoolIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1550,6 +1605,9 @@ func (c *castDecimalBoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1564,6 +1622,9 @@ func (c *castDecimalBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1587,6 +1648,9 @@ func (c *castDecimalBoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1601,6 +1665,9 @@ func (c *castDecimalBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1659,6 +1726,9 @@ func (c *castDecimalInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1692,6 +1762,9 @@ func (c *castDecimalInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1734,6 +1807,9 @@ func (c *castDecimalInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1767,6 +1843,9 @@ func (c *castDecimalInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1844,6 +1923,9 @@ func (c *castDecimalInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1877,6 +1959,9 @@ func (c *castDecimalInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -1919,6 +2004,9 @@ func (c *castDecimalInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -1952,6 +2040,9 @@ func (c *castDecimalInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2029,6 +2120,9 @@ func (c *castDecimalIntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2056,6 +2150,9 @@ func (c *castDecimalIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2092,6 +2189,9 @@ func (c *castDecimalIntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2119,6 +2219,9 @@ func (c *castDecimalIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2185,6 +2288,9 @@ func (c *castDecimalFloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2207,6 +2313,9 @@ func (c *castDecimalFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2238,6 +2347,9 @@ func (c *castDecimalFloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2260,6 +2372,9 @@ func (c *castDecimalFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2321,6 +2436,9 @@ func (c *castDecimalDecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2340,6 +2458,9 @@ func (c *castDecimalDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2368,6 +2489,9 @@ func (c *castDecimalDecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2387,6 +2511,9 @@ func (c *castDecimalDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2445,6 +2572,9 @@ func (c *castInt2Int4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2459,6 +2589,9 @@ func (c *castInt2Int4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2482,6 +2615,9 @@ func (c *castInt2Int4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2496,6 +2632,9 @@ func (c *castInt2Int4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2549,6 +2688,9 @@ func (c *castInt2IntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2563,6 +2705,9 @@ func (c *castInt2IntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2586,6 +2731,9 @@ func (c *castInt2IntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2600,6 +2748,9 @@ func (c *castInt2IntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2653,6 +2804,9 @@ func (c *castInt2BoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2669,6 +2823,9 @@ func (c *castInt2BoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2694,6 +2851,9 @@ func (c *castInt2BoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2710,6 +2870,9 @@ func (c *castInt2BoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2765,6 +2928,9 @@ func (c *castInt2DecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2785,6 +2951,9 @@ func (c *castInt2DecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2814,6 +2983,9 @@ func (c *castInt2DecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2834,6 +3006,9 @@ func (c *castInt2DecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2893,6 +3068,9 @@ func (c *castInt2FloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2909,6 +3087,9 @@ func (c *castInt2FloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -2934,6 +3115,9 @@ func (c *castInt2FloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -2950,6 +3134,9 @@ func (c *castInt2FloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3005,6 +3192,9 @@ func (c *castInt4Int2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3025,6 +3215,9 @@ func (c *castInt4Int2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3054,6 +3247,9 @@ func (c *castInt4Int2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3074,6 +3270,9 @@ func (c *castInt4Int2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3133,6 +3332,9 @@ func (c *castInt4IntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3147,6 +3349,9 @@ func (c *castInt4IntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3170,6 +3375,9 @@ func (c *castInt4IntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3184,6 +3392,9 @@ func (c *castInt4IntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3237,6 +3448,9 @@ func (c *castInt4BoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3253,6 +3467,9 @@ func (c *castInt4BoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3278,6 +3495,9 @@ func (c *castInt4BoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3294,6 +3514,9 @@ func (c *castInt4BoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3349,6 +3572,9 @@ func (c *castInt4DecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3369,6 +3595,9 @@ func (c *castInt4DecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3398,6 +3627,9 @@ func (c *castInt4DecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3418,6 +3650,9 @@ func (c *castInt4DecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3477,6 +3712,9 @@ func (c *castInt4FloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3493,6 +3731,9 @@ func (c *castInt4FloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3518,6 +3759,9 @@ func (c *castInt4FloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3534,6 +3778,9 @@ func (c *castInt4FloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3589,6 +3836,9 @@ func (c *castIntInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3609,6 +3859,9 @@ func (c *castIntInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3638,6 +3891,9 @@ func (c *castIntInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3658,6 +3914,9 @@ func (c *castIntInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3717,6 +3976,9 @@ func (c *castIntInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3737,6 +3999,9 @@ func (c *castIntInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3766,6 +4031,9 @@ func (c *castIntInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3786,6 +4054,9 @@ func (c *castIntInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3845,6 +4116,9 @@ func (c *castIntBoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3861,6 +4135,9 @@ func (c *castIntBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3886,6 +4163,9 @@ func (c *castIntBoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3902,6 +4182,9 @@ func (c *castIntBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -3957,6 +4240,9 @@ func (c *castIntDecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -3977,6 +4263,9 @@ func (c *castIntDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4006,6 +4295,9 @@ func (c *castIntDecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4026,6 +4318,9 @@ func (c *castIntDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4085,6 +4380,9 @@ func (c *castIntFloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4101,6 +4399,9 @@ func (c *castIntFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4126,6 +4427,9 @@ func (c *castIntFloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4142,6 +4446,9 @@ func (c *castIntFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4197,6 +4504,9 @@ func (c *castFloatBoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4213,6 +4523,9 @@ func (c *castFloatBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4238,6 +4551,9 @@ func (c *castFloatBoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4254,6 +4570,9 @@ func (c *castFloatBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4309,6 +4628,9 @@ func (c *castFloatDecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4331,6 +4653,9 @@ func (c *castFloatDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4362,6 +4687,9 @@ func (c *castFloatDecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4384,6 +4712,9 @@ func (c *castFloatDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4445,6 +4776,9 @@ func (c *castFloatInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4464,6 +4798,9 @@ func (c *castFloatInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4492,6 +4829,9 @@ func (c *castFloatInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4511,6 +4851,9 @@ func (c *castFloatInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4569,6 +4912,9 @@ func (c *castFloatInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4588,6 +4934,9 @@ func (c *castFloatInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4616,6 +4965,9 @@ func (c *castFloatInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4635,6 +4987,9 @@ func (c *castFloatInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4693,6 +5048,9 @@ func (c *castFloatIntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4712,6 +5070,9 @@ func (c *castFloatIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4740,6 +5101,9 @@ func (c *castFloatIntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4759,6 +5123,9 @@ func (c *castFloatIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4817,6 +5184,9 @@ func (c *castDateInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4837,6 +5207,9 @@ func (c *castDateInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4866,6 +5239,9 @@ func (c *castDateInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4886,6 +5262,9 @@ func (c *castDateInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4945,6 +5324,9 @@ func (c *castDateInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -4965,6 +5347,9 @@ func (c *castDateInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -4994,6 +5379,9 @@ func (c *castDateInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5014,6 +5402,9 @@ func (c *castDateInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5073,6 +5464,9 @@ func (c *castDateIntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5087,6 +5481,9 @@ func (c *castDateIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5110,6 +5507,9 @@ func (c *castDateIntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5124,6 +5524,9 @@ func (c *castDateIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5177,6 +5580,9 @@ func (c *castDateFloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5193,6 +5599,9 @@ func (c *castDateFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5218,6 +5627,9 @@ func (c *castDateFloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5234,6 +5646,9 @@ func (c *castDateFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5289,6 +5704,9 @@ func (c *castDateDecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5309,6 +5727,9 @@ func (c *castDateDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5338,6 +5759,9 @@ func (c *castDateDecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5358,6 +5782,9 @@ func (c *castDateDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = inputCol.Get(n - 1) _ = outputCol.Get(n - 1) var tupleIdx int @@ -5417,6 +5844,9 @@ func (c *castBytesUuidOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5437,6 +5867,9 @@ func (c *castBytesUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5462,6 +5895,9 @@ func (c *castBytesUuidOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5482,6 +5918,9 @@ func (c *castBytesUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5537,6 +5976,9 @@ func (c *castStringBoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5557,6 +5999,9 @@ func (c *castStringBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -5584,6 +6029,9 @@ func (c *castStringBoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5604,6 +6052,9 @@ func (c *castStringBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -5661,6 +6112,9 @@ func (c *castStringBytesOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5681,6 +6135,9 @@ func (c *castStringBytesOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5706,6 +6163,9 @@ func (c *castStringBytesOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5726,6 +6186,9 @@ func (c *castStringBytesOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5781,6 +6244,9 @@ func (c *castStringStringOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5821,6 +6287,9 @@ func (c *castStringStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5866,6 +6335,9 @@ func (c *castStringStringOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -5906,6 +6378,9 @@ func (c *castStringStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -5981,6 +6456,9 @@ func (c *castStringUuidOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6001,6 +6479,9 @@ func (c *castStringUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -6026,6 +6507,9 @@ func (c *castStringUuidOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6046,6 +6530,9 @@ func (c *castStringUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -6101,6 +6588,9 @@ func (c *castJsonbStringOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6126,6 +6616,9 @@ func (c *castJsonbStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -6156,6 +6649,9 @@ func (c *castJsonbStringOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6181,6 +6677,9 @@ func (c *castJsonbStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -6242,6 +6741,9 @@ func (c *castDatumBoolOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6252,7 +6754,7 @@ func (c *castDatumBoolOp) Next() coldata.Batch { var r bool { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6264,6 +6766,9 @@ func (c *castDatumBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6275,7 +6780,7 @@ func (c *castDatumBoolOp) Next() coldata.Batch { var r bool { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6293,6 +6798,9 @@ func (c *castDatumBoolOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6303,7 +6811,7 @@ func (c *castDatumBoolOp) Next() coldata.Batch { var r bool { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6315,6 +6823,9 @@ func (c *castDatumBoolOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6326,7 +6837,7 @@ func (c *castDatumBoolOp) Next() coldata.Batch { var r bool { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6375,6 +6886,9 @@ func (c *castDatumInt2Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6385,7 +6899,7 @@ func (c *castDatumInt2Op) Next() coldata.Batch { var r int16 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6397,6 +6911,9 @@ func (c *castDatumInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6408,7 +6925,7 @@ func (c *castDatumInt2Op) Next() coldata.Batch { var r int16 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6426,6 +6943,9 @@ func (c *castDatumInt2Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6436,7 +6956,7 @@ func (c *castDatumInt2Op) Next() coldata.Batch { var r int16 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6448,6 +6968,9 @@ func (c *castDatumInt2Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6459,7 +6982,7 @@ func (c *castDatumInt2Op) Next() coldata.Batch { var r int16 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6508,6 +7031,9 @@ func (c *castDatumInt4Op) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6518,7 +7044,7 @@ func (c *castDatumInt4Op) Next() coldata.Batch { var r int32 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6530,6 +7056,9 @@ func (c *castDatumInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6541,7 +7070,7 @@ func (c *castDatumInt4Op) Next() coldata.Batch { var r int32 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6559,6 +7088,9 @@ func (c *castDatumInt4Op) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6569,7 +7101,7 @@ func (c *castDatumInt4Op) Next() coldata.Batch { var r int32 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6581,6 +7113,9 @@ func (c *castDatumInt4Op) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6592,7 +7127,7 @@ func (c *castDatumInt4Op) Next() coldata.Batch { var r int32 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6641,6 +7176,9 @@ func (c *castDatumIntOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6651,7 +7189,7 @@ func (c *castDatumIntOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6663,6 +7201,9 @@ func (c *castDatumIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6674,7 +7215,7 @@ func (c *castDatumIntOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6692,6 +7233,9 @@ func (c *castDatumIntOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6702,7 +7246,7 @@ func (c *castDatumIntOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6714,6 +7258,9 @@ func (c *castDatumIntOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6725,7 +7272,7 @@ func (c *castDatumIntOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6774,6 +7321,9 @@ func (c *castDatumFloatOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6784,7 +7334,7 @@ func (c *castDatumFloatOp) Next() coldata.Batch { var r float64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6796,6 +7346,9 @@ func (c *castDatumFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6807,7 +7360,7 @@ func (c *castDatumFloatOp) Next() coldata.Batch { var r float64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6825,6 +7378,9 @@ func (c *castDatumFloatOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6835,7 +7391,7 @@ func (c *castDatumFloatOp) Next() coldata.Batch { var r float64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6847,6 +7403,9 @@ func (c *castDatumFloatOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6858,7 +7417,7 @@ func (c *castDatumFloatOp) Next() coldata.Batch { var r float64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6907,6 +7466,9 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6917,7 +7479,7 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { var r apd.Decimal { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6929,6 +7491,9 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6940,7 +7505,7 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { var r apd.Decimal { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6958,6 +7523,9 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -6968,7 +7536,7 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { var r apd.Decimal { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -6980,6 +7548,9 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -6991,7 +7562,7 @@ func (c *castDatumDecimalOp) Next() coldata.Batch { var r apd.Decimal { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7040,6 +7611,9 @@ func (c *castDatumDateOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7050,7 +7624,7 @@ func (c *castDatumDateOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7062,6 +7636,9 @@ func (c *castDatumDateOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7073,7 +7650,7 @@ func (c *castDatumDateOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7091,6 +7668,9 @@ func (c *castDatumDateOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7101,7 +7681,7 @@ func (c *castDatumDateOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7113,6 +7693,9 @@ func (c *castDatumDateOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7124,7 +7707,7 @@ func (c *castDatumDateOp) Next() coldata.Batch { var r int64 { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7173,6 +7756,9 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7183,7 +7769,7 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7195,6 +7781,9 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7206,7 +7795,7 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7224,6 +7813,9 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7234,7 +7826,7 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7246,6 +7838,9 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7257,7 +7852,7 @@ func (c *castDatumTimestampOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7306,6 +7901,9 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7316,7 +7914,7 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { var r duration.Duration { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7328,6 +7926,9 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7339,7 +7940,7 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { var r duration.Duration { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7357,6 +7958,9 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7367,7 +7971,7 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { var r duration.Duration { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7379,6 +7983,9 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7390,7 +7997,7 @@ func (c *castDatumIntervalOp) Next() coldata.Batch { var r duration.Duration { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7439,6 +8046,9 @@ func (c *castDatumStringOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7449,7 +8059,7 @@ func (c *castDatumStringOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7461,6 +8071,9 @@ func (c *castDatumStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7471,7 +8084,7 @@ func (c *castDatumStringOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7488,6 +8101,9 @@ func (c *castDatumStringOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7498,7 +8114,7 @@ func (c *castDatumStringOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7510,6 +8126,9 @@ func (c *castDatumStringOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7520,7 +8139,7 @@ func (c *castDatumStringOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7568,6 +8187,9 @@ func (c *castDatumBytesOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7578,7 +8200,7 @@ func (c *castDatumBytesOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7590,6 +8212,9 @@ func (c *castDatumBytesOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7600,7 +8225,7 @@ func (c *castDatumBytesOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7617,6 +8242,9 @@ func (c *castDatumBytesOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7627,7 +8255,7 @@ func (c *castDatumBytesOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7639,6 +8267,9 @@ func (c *castDatumBytesOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7649,7 +8280,7 @@ func (c *castDatumBytesOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7697,6 +8328,9 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7707,7 +8341,7 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7719,6 +8353,9 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7730,7 +8367,7 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7748,6 +8385,9 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7758,7 +8398,7 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7770,6 +8410,9 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx _ = outputCol.Get(n - 1) var tupleIdx int for i := 0; i < n; i++ { @@ -7781,7 +8424,7 @@ func (c *castDatumTimestamptzOp) Next() coldata.Batch { var r time.Time { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7830,6 +8473,9 @@ func (c *castDatumUuidOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7840,7 +8486,7 @@ func (c *castDatumUuidOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7852,6 +8498,9 @@ func (c *castDatumUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7862,7 +8511,7 @@ func (c *castDatumUuidOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7879,6 +8528,9 @@ func (c *castDatumUuidOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7889,7 +8541,7 @@ func (c *castDatumUuidOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7901,6 +8553,9 @@ func (c *castDatumUuidOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7911,7 +8566,7 @@ func (c *castDatumUuidOp) Next() coldata.Batch { var r []byte { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7959,6 +8614,9 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -7969,7 +8627,7 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { var r json.JSON { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -7981,6 +8639,9 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -7991,7 +8652,7 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { var r json.JSON { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8008,6 +8669,9 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -8018,7 +8682,7 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { var r json.JSON { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8030,6 +8694,9 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -8040,7 +8707,7 @@ func (c *castDatumJsonbOp) Next() coldata.Batch { var r json.JSON { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8087,6 +8754,9 @@ func (c *castDatumDatumOp) Next() coldata.Batch { outputNulls.Copy(inputNulls) if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -8097,7 +8767,7 @@ func (c *castDatumDatumOp) Next() coldata.Batch { var r interface{} { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8115,6 +8785,9 @@ func (c *castDatumDatumOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -8125,7 +8798,7 @@ func (c *castDatumDatumOp) Next() coldata.Batch { var r interface{} { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8148,6 +8821,9 @@ func (c *castDatumDatumOp) Next() coldata.Batch { outputNulls.UnsetNulls() if sel != nil { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = sel[i] @@ -8158,7 +8834,7 @@ func (c *castDatumDatumOp) Next() coldata.Batch { var r interface{} { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -8176,6 +8852,9 @@ func (c *castDatumDatumOp) Next() coldata.Batch { } } else { { + var evalCtx *tree.EvalContext = c.evalCtx + // Silence unused warning. + _ = evalCtx var tupleIdx int for i := 0; i < n; i++ { tupleIdx = i @@ -8186,7 +8865,7 @@ func (c *castDatumDatumOp) Next() coldata.Batch { var r interface{} { - _castedDatum, err := v.(*coldataext.Datum).Cast(inputCol, toType) + _castedDatum, err := tree.PerformCast(evalCtx, v.(*coldataext.Datum).Datum, toType) if err != nil { colexecerror.ExpectedError(err) } diff --git a/pkg/sql/colexec/colexecbase/cast_test.go b/pkg/sql/colexec/colexecbase/cast_test.go index d4816abe753c..4e5c330c04c3 100644 --- a/pkg/sql/colexec/colexecbase/cast_test.go +++ b/pkg/sql/colexec/colexecbase/cast_test.go @@ -94,7 +94,7 @@ func TestRandomizedCast(t *testing.T) { colexectestutils.RunTestsWithoutAllNullsInjectionWithErrorHandler( t, testAllocator, []colexectestutils.Tuples{input}, [][]*types.T{{from}}, output, colexectestutils.OrderedVerifier, func(input []colexecop.Operator) (colexecop.Operator, error) { - return colexecbase.GetCastOperator(testAllocator, input[0], 0, 1, from, to) + return colexecbase.GetCastOperator(testAllocator, input[0], 0, 1, from, to, &evalCtx) }, func(err error) { if !errorExpected { @@ -137,7 +137,7 @@ func BenchmarkCastOp(b *testing.B) { coldata.BatchSize(), nullProbability, selectivity, ) source := colexecop.NewRepeatableBatchSource(testAllocator, batch, typs) - op, err := colexecbase.GetCastOperator(testAllocator, source, 0, 1, typePair[0], typePair[1]) + op, err := colexecbase.GetCastOperator(testAllocator, source, 0, 1, typePair[0], typePair[1], &evalCtx) require.NoError(b, err) b.SetBytes(int64(8 * coldata.BatchSize())) b.ResetTimer() diff --git a/pkg/sql/colexec/colexecbase/cast_tmpl.go b/pkg/sql/colexec/colexecbase/cast_tmpl.go index 4e2b1a2191b7..9d012c7a761e 100644 --- a/pkg/sql/colexec/colexecbase/cast_tmpl.go +++ b/pkg/sql/colexec/colexecbase/cast_tmpl.go @@ -106,6 +106,7 @@ func GetCastOperator( resultIdx int, fromType *types.T, toType *types.T, + evalCtx *tree.EvalContext, ) (colexecop.Operator, error) { input = colexecutils.NewVectorTypeEnforcer(allocator, input, toType, resultIdx) base := castOpBase{ @@ -113,6 +114,7 @@ func GetCastOperator( allocator: allocator, colIdx: colIdx, outputIdx: resultIdx, + evalCtx: evalCtx, } if fromType.Family() == types.UnknownFamily { return &castOpNullAny{castOpBase: base}, nil @@ -227,6 +229,7 @@ type castOpBase struct { allocator *colmem.Allocator colIdx int outputIdx int + evalCtx *tree.EvalContext } func (c *castOpBase) Reset(ctx context.Context) { @@ -353,22 +356,22 @@ func (c *castNativeToDatumOp) Next() coldata.Batch { if sel != nil { if inputVec.Nulls().MaybeHasNulls() { for scratchIdx, outputIdx := range sel[:n] { - setNativeToDatumCast(outputCol, outputNulls, scratch, scratchIdx, outputIdx, toType, true, false) + setNativeToDatumCast(outputCol, outputNulls, scratch, scratchIdx, outputIdx, toType, c.evalCtx, true, false) } } else { for scratchIdx, outputIdx := range sel[:n] { - setNativeToDatumCast(outputCol, outputNulls, scratch, scratchIdx, outputIdx, toType, false, false) + setNativeToDatumCast(outputCol, outputNulls, scratch, scratchIdx, outputIdx, toType, c.evalCtx, false, false) } } } else { _ = scratch[n-1] if inputVec.Nulls().MaybeHasNulls() { for idx := 0; idx < n; idx++ { - setNativeToDatumCast(outputCol, outputNulls, scratch, idx, idx, toType, true, true) + setNativeToDatumCast(outputCol, outputNulls, scratch, idx, idx, toType, c.evalCtx, true, true) } } else { for idx := 0; idx < n; idx++ { - setNativeToDatumCast(outputCol, outputNulls, scratch, idx, idx, toType, false, true) + setNativeToDatumCast(outputCol, outputNulls, scratch, idx, idx, toType, c.evalCtx, false, true) } } } @@ -388,6 +391,7 @@ func setNativeToDatumCast( scratchIdx int, outputIdx int, toType *types.T, + evalCtx *tree.EvalContext, hasNulls bool, scratchBCE bool, ) { @@ -399,7 +403,7 @@ func setNativeToDatumCast( outputNulls.SetNull(outputIdx) continue } - res, err := coldataext.PerformCast(outputCol, converted, toType) + res, err := tree.PerformCast(evalCtx, converted, toType) if err != nil { colexecerror.ExpectedError(err) } @@ -457,18 +461,18 @@ func (c *cast_NAMEOp) Next() coldata.Batch { if inputVec.MaybeHasNulls() { outputNulls.Copy(inputNulls) if sel != nil { - castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, true, true) + castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, c.evalCtx, true, true) } else { - castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, true, false) + castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, c.evalCtx, true, false) } } else { // We need to make sure that there are no left over null values // in the output vector. outputNulls.UnsetNulls() if sel != nil { - castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, false, true) + castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, c.evalCtx, false, true) } else { - castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, false, false) + castTuples(inputCol, inputNulls, outputCol, outputNulls, toType, n, sel, c.evalCtx, false, false) } } // {{/* @@ -533,9 +537,12 @@ func castTuples( toType *types.T, n int, sel []int, + evalCtx *tree.EvalContext, hasNulls bool, hasSel bool, ) { + // Silence unused warning. + _ = evalCtx if !hasSel { // {{if $fromInfo.Sliceable}} _ = inputCol.Get(n - 1) @@ -561,7 +568,7 @@ func castTuples( } v := inputCol.Get(tupleIdx) var r _TO_GO_TYPE - _CAST(r, v, inputCol, toType) + _CAST(r, v, evalCtx, toType) if !hasSel { // {{if .Sliceable}} //gcassert:bce diff --git a/pkg/sql/colexec/colexecjoin/mergejoiner.go b/pkg/sql/colexec/colexecjoin/mergejoiner.go index 7fd1dd3a3e8a..314ca0f60925 100644 --- a/pkg/sql/colexec/colexecjoin/mergejoiner.go +++ b/pkg/sql/colexec/colexecjoin/mergejoiner.go @@ -24,6 +24,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/colexecop" "github.com/cockroachdb/cockroach/pkg/sql/colmem" "github.com/cockroachdb/cockroach/pkg/sql/execinfrapb" + "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/types" "github.com/cockroachdb/cockroach/pkg/util/mon" "github.com/cockroachdb/errors" @@ -224,6 +225,7 @@ func NewMergeJoinOp( leftOrdering []execinfrapb.Ordering_Column, rightOrdering []execinfrapb.Ordering_Column, diskAcc *mon.BoundAccount, + evalCtx *tree.EvalContext, ) (colexecop.ResettableOperator, error) { // Merge joiner only supports the case when the physical types in the // equality columns in both inputs are the same. We, however, also need to @@ -273,7 +275,7 @@ func NewMergeJoinOp( } if castLeftToRight { castColumnIdx := len(actualLeftTypes) - left, err = colexecbase.GetCastOperator(unlimitedAllocator, left, int(leftColIdx), castColumnIdx, leftType, rightType) + left, err = colexecbase.GetCastOperator(unlimitedAllocator, left, int(leftColIdx), castColumnIdx, leftType, rightType, evalCtx) if err != nil { return nil, err } @@ -281,7 +283,7 @@ func NewMergeJoinOp( actualLeftOrdering[i].ColIdx = uint32(castColumnIdx) } else { castColumnIdx := len(actualRightTypes) - right, err = colexecbase.GetCastOperator(unlimitedAllocator, right, int(rightColIdx), castColumnIdx, rightType, leftType) + right, err = colexecbase.GetCastOperator(unlimitedAllocator, right, int(rightColIdx), castColumnIdx, rightType, leftType, evalCtx) if err != nil { return nil, err } diff --git a/pkg/sql/colexec/colexecjoin/mergejoiner_test.go b/pkg/sql/colexec/colexecjoin/mergejoiner_test.go index 9afcab2df273..8b3e482a245f 100644 --- a/pkg/sql/colexec/colexecjoin/mergejoiner_test.go +++ b/pkg/sql/colexec/colexecjoin/mergejoiner_test.go @@ -101,7 +101,7 @@ func TestMergeJoinCrossProduct(t *testing.T) { leftMJSource, rightMJSource, typs, typs, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, - testDiskAcc, + testDiskAcc, evalCtx, ) if err != nil { t.Fatal("error in merge join op constructor", err) diff --git a/pkg/sql/colexec/execgen/cmd/execgen/cast_gen_util.go b/pkg/sql/colexec/execgen/cmd/execgen/cast_gen_util.go index 03f913b7d02d..06e9db193243 100644 --- a/pkg/sql/colexec/execgen/cmd/execgen/cast_gen_util.go +++ b/pkg/sql/colexec/execgen/cmd/execgen/cast_gen_util.go @@ -115,7 +115,7 @@ func getDecimalToIntCastFunc(toIntWidth int32) castFunc { if toIntWidth == anyWidth { toIntWidth = 64 } - return func(to, from, fromCol, toType string) string { + return func(to, from, evalCtx, toType string) string { // convStr is a format string expecting three arguments: // 1. the code snippet that performs an assigment of int64 local // variable named '_i' to the result, possibly performing the bounds @@ -146,7 +146,7 @@ func getDecimalToIntCastFunc(toIntWidth int32) castFunc { } return fmt.Sprintf( convStr, - getIntToIntCastFunc(64 /* fromWidth */, toIntWidth)(to, "_i" /* from */, fromCol, toType), + getIntToIntCastFunc(64 /* fromWidth */, toIntWidth)(to, "_i" /* from */, evalCtx, toType), from, errOutOfRange, ) @@ -363,31 +363,31 @@ func jsonToString(to, from, _, toType string) string { func getDatumToNativeCastFunc( nonDatumPhysicalRepresentation string, ) func(string, string, string, string) string { - return func(to, from, fromCol, toType string) string { + return func(to, from, evalCtx, toType string) string { convStr := ` { - _castedDatum, err := %[2]s.(*coldataext.Datum).Cast(%[3]s, %[4]s) + _castedDatum, err := tree.PerformCast(%[3]s, %[2]s.(*coldataext.Datum).Datum, %[4]s) if err != nil { colexecerror.ExpectedError(err) } %[1]s = converter(_castedDatum).(%[5]s) } ` - return fmt.Sprintf(convStr, to, from, fromCol, toType, nonDatumPhysicalRepresentation) + return fmt.Sprintf(convStr, to, from, evalCtx, toType, nonDatumPhysicalRepresentation) } } -func datumToDatum(to, from, fromCol, toType string) string { +func datumToDatum(to, from, evalCtx, toType string) string { convStr := ` { - _castedDatum, err := %[2]s.(*coldataext.Datum).Cast(%[3]s, %[4]s) + _castedDatum, err := tree.PerformCast(%[3]s, %[2]s.(*coldataext.Datum).Datum, %[4]s) if err != nil { colexecerror.ExpectedError(err) } %[1]s = _castedDatum } ` - return fmt.Sprintf(convStr, to, from, fromCol, toType) + return fmt.Sprintf(convStr, to, from, evalCtx, toType) } // The structs below form 4-leveled hierarchy (similar to two-argument @@ -499,8 +499,8 @@ func (i castToWidthTmplInfo) TypeName() string { return getTypeName(i.toType) } -func (i castToWidthTmplInfo) Cast(to, from, fromCol, toType string) string { - return i.CastFn(to, from, fromCol, toType) +func (i castToWidthTmplInfo) Cast(to, from, evalCtx, toType string) string { + return i.CastFn(to, from, evalCtx, toType) } func (i castToWidthTmplInfo) Sliceable() bool { @@ -523,8 +523,8 @@ func (i castDatumToWidthTmplInfo) TypeName() string { return getTypeName(i.toType) } -func (i castDatumToWidthTmplInfo) Cast(to, from, fromCol, toType string) string { - return i.CastFn(to, from, fromCol, toType) +func (i castDatumToWidthTmplInfo) Cast(to, from, evalCtx, toType string) string { + return i.CastFn(to, from, evalCtx, toType) } func (i castDatumToWidthTmplInfo) Sliceable() bool { @@ -535,8 +535,8 @@ func (i castBetweenDatumsTmplInfo) TypeName() string { return datumVecTypeName } -func (i castBetweenDatumsTmplInfo) Cast(to, from, fromCol, toType string) string { - return datumToDatum(to, from, fromCol, toType) +func (i castBetweenDatumsTmplInfo) Cast(to, from, evalCtx, toType string) string { + return datumToDatum(to, from, evalCtx, toType) } func (i castBetweenDatumsTmplInfo) Sliceable() bool { diff --git a/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go b/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go index 3839286f24eb..a975794797a9 100644 --- a/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go +++ b/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go @@ -351,7 +351,7 @@ type twoArgsResolvedOverloadRightWidthInfo struct { type assignFunc func(op *lastArgWidthOverload, targetElem, leftElem, rightElem, targetCol, leftCol, rightCol string) string type compareFunc func(targetElem, leftElem, rightElem, leftCol, rightCol string) string -type castFunc func(to, from, fromCol, toType string) string +type castFunc func(to, from, evalCtx, toType string) string // Assign produces a Go source string that assigns the "targetElem" variable to // the result of applying the overload to the two inputs, "leftElem" and diff --git a/pkg/sql/colexec/external_hash_joiner.go b/pkg/sql/colexec/external_hash_joiner.go index fd72e6b5e9c1..f9e9f17fb9dd 100644 --- a/pkg/sql/colexec/external_hash_joiner.go +++ b/pkg/sql/colexec/external_hash_joiner.go @@ -133,7 +133,7 @@ func NewExternalHashJoiner( diskBackedSortMerge, err := colexecjoin.NewMergeJoinOp( unlimitedAllocator, memoryLimit, args.DiskQueueCfg, fdSemaphore, spec.JoinType, leftPartitionSorter, rightPartitionSorter, spec.Left.SourceTypes, - spec.Right.SourceTypes, leftOrdering, rightOrdering, diskAcc, + spec.Right.SourceTypes, leftOrdering, rightOrdering, diskAcc, flowCtx.EvalCtx, ) if err != nil { colexecerror.InternalError(err) diff --git a/pkg/sql/colexec/mergejoiner_test.go b/pkg/sql/colexec/mergejoiner_test.go index fe0773e78f9b..3c1d63c7d7d0 100644 --- a/pkg/sql/colexec/mergejoiner_test.go +++ b/pkg/sql/colexec/mergejoiner_test.go @@ -1702,6 +1702,8 @@ func TestFullOuterMergeJoinWithMaximumNumberOfGroups(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) ctx := context.Background() + evalCtx := tree.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + defer evalCtx.Stop(ctx) nTuples := coldata.BatchSize() * 4 queueCfg, cleanup := colcontainerutils.NewTestingDiskQueueCfg(t, true /* inMem */) defer cleanup() @@ -1722,7 +1724,7 @@ func TestFullOuterMergeJoinWithMaximumNumberOfGroups(t *testing.T) { leftSource, rightSource, typs, typs, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, - testDiskAcc, + testDiskAcc, &evalCtx, ) if err != nil { t.Fatal("error in merge join op constructor", err) @@ -1773,6 +1775,8 @@ func TestMergeJoinerMultiBatch(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) ctx := context.Background() + evalCtx := tree.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + defer evalCtx.Stop(ctx) queueCfg, cleanup := colcontainerutils.NewTestingDiskQueueCfg(t, true /* inMem */) defer cleanup() for _, numInputBatches := range []int{1, 2, 16} { @@ -1793,7 +1797,7 @@ func TestMergeJoinerMultiBatch(t *testing.T) { leftSource, rightSource, typs, typs, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, - testDiskAcc, + testDiskAcc, &evalCtx, ) if err != nil { t.Fatal("error in merge join op constructor", err) @@ -1830,6 +1834,8 @@ func TestMergeJoinerMultiBatchRuns(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) ctx := context.Background() + evalCtx := tree.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + defer evalCtx.Stop(ctx) queueCfg, cleanup := colcontainerutils.NewTestingDiskQueueCfg(t, true /* inMem */) defer cleanup() for _, groupSize := range []int{coldata.BatchSize() / 8, coldata.BatchSize() / 4, coldata.BatchSize() / 2} { @@ -1869,7 +1875,7 @@ func TestMergeJoinerMultiBatchRuns(t *testing.T) { leftSource, rightSource, typs, typs, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}, {ColIdx: 1, Direction: execinfrapb.Ordering_Column_ASC}}, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}, {ColIdx: 1, Direction: execinfrapb.Ordering_Column_ASC}}, - testDiskAcc, + testDiskAcc, &evalCtx, ) if err != nil { t.Fatal("error in merge join op constructor", err) @@ -1978,6 +1984,8 @@ func TestMergeJoinerRandomized(t *testing.T) { defer leaktest.AfterTest(t)() defer log.Scope(t).Close(t) ctx := context.Background() + evalCtx := tree.MakeTestingEvalContext(cluster.MakeTestingClusterSettings()) + defer evalCtx.Stop(ctx) queueCfg, cleanup := colcontainerutils.NewTestingDiskQueueCfg(t, true /* inMem */) defer cleanup() for _, numInputBatches := range []int{1, 2, 16, 256} { @@ -1997,7 +2005,7 @@ func TestMergeJoinerRandomized(t *testing.T) { leftSource, rightSource, typs, typs, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, []execinfrapb.Ordering_Column{{ColIdx: 0, Direction: execinfrapb.Ordering_Column_ASC}}, - testDiskAcc, + testDiskAcc, &evalCtx, ) if err != nil { t.Fatal("error in merge join op constructor", err) diff --git a/pkg/sql/colflow/routers_test.go b/pkg/sql/colflow/routers_test.go index 2ba9e37b99ce..b68f643f1783 100644 --- a/pkg/sql/colflow/routers_test.go +++ b/pkg/sql/colflow/routers_test.go @@ -51,6 +51,7 @@ type testUtils struct { // testAllocator is an Allocator with an unlimited budget for use in tests. testAllocator *colmem.Allocator testColumnFactory coldata.ColumnFactory + evalCtx *tree.EvalContext // testMemMonitor and testMemAcc are a test monitor with an unlimited budget // and a memory account bound to it for use in tests. @@ -75,6 +76,7 @@ func newTestUtils(ctx context.Context) *testUtils { return &testUtils{ testAllocator: testAllocator, testColumnFactory: testColumnFactory, + evalCtx: &evalCtx, testMemMonitor: testMemMonitor, testMemAcc: &memAcc, testDiskMonitor: testDiskMonitor, diff --git a/pkg/sql/colflow/stats_test.go b/pkg/sql/colflow/stats_test.go index ec61ebbe30e9..01ac67a2e787 100644 --- a/pkg/sql/colflow/stats_test.go +++ b/pkg/sql/colflow/stats_test.go @@ -122,7 +122,7 @@ func TestVectorizedStatsCollector(t *testing.T) { []*types.T{types.Int}, []*types.T{types.Int}, []execinfrapb.Ordering_Column{{ColIdx: 0}}, []execinfrapb.Ordering_Column{{ColIdx: 0}}, - tu.testDiskAcc, + tu.testDiskAcc, tu.evalCtx, ) if err != nil { t.Fatal(err)