diff --git a/pkg/sql/backfill/backfill.go b/pkg/sql/backfill/backfill.go index 4ba3887d1ab3..988486acfb9d 100644 --- a/pkg/sql/backfill/backfill.go +++ b/pkg/sql/backfill/backfill.go @@ -86,7 +86,7 @@ type ColumnBackfiller struct { // mon is a memory monitor linked with the ColumnBackfiller on creation. mon *mon.BytesMonitor - rowMetrics *row.Metrics + rowMetrics *rowinfra.Metrics } // initCols is a helper to populate some column metadata on a ColumnBackfiller. @@ -111,7 +111,7 @@ func (cb *ColumnBackfiller) init( computedExprs []tree.TypedExpr, desc catalog.TableDescriptor, mon *mon.BytesMonitor, - rowMetrics *row.Metrics, + rowMetrics *rowinfra.Metrics, ) error { cb.evalCtx = evalCtx cb.updateCols = append(cb.added, cb.dropped...) @@ -171,7 +171,7 @@ func (cb *ColumnBackfiller) InitForLocalUse( semaCtx *tree.SemaContext, desc catalog.TableDescriptor, mon *mon.BytesMonitor, - rowMetrics *row.Metrics, + rowMetrics *rowinfra.Metrics, ) error { cb.initCols(desc) defaultExprs, err := schemaexpr.MakeDefaultExprs( diff --git a/pkg/sql/colexec/colexecbase/BUILD.bazel b/pkg/sql/colexec/colexecbase/BUILD.bazel index bfeb76cd52b4..39cab1ce0e9c 100644 --- a/pkg/sql/colexec/colexecbase/BUILD.bazel +++ b/pkg/sql/colexec/colexecbase/BUILD.bazel @@ -8,7 +8,6 @@ go_library( "distinct.go", "fn_op.go", "ordinality.go", - "overloads_bin_util.go", "simple_project.go", ":gen-exec", # keep ], diff --git a/pkg/sql/colexec/colexecproj/BUILD.bazel b/pkg/sql/colexec/colexecproj/BUILD.bazel index 0123603888a1..8558f01924e3 100644 --- a/pkg/sql/colexec/colexecproj/BUILD.bazel +++ b/pkg/sql/colexec/colexecproj/BUILD.bazel @@ -15,7 +15,6 @@ go_library( "//pkg/col/typeconv", # keep "//pkg/server/telemetry", # keep "//pkg/sql/colconv", # keep - "//pkg/sql/colexec/colexecbase", # keep "//pkg/sql/colexec/colexeccmp", # keep "//pkg/sql/colexec/colexecutils", # keep "//pkg/sql/colexec/execgen", # keep @@ -97,6 +96,7 @@ disallowed_imports_test( [ "//pkg/sql/colexec", "//pkg/sql/colexec/colexecagg", + "//pkg/sql/colexec/colexecbase", "//pkg/sql/colexec/colexechash", "//pkg/sql/colexec/colexecjoin", "//pkg/sql/colexec/colexecprojconst", diff --git a/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go b/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go index 86f8c4fd7837..cdc8955aab77 100644 --- a/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go +++ b/pkg/sql/colexec/colexecproj/proj_non_const_ops.eg.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexeccmp" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" @@ -921,7 +920,7 @@ func (p projBitandInt64Int64Op) Next() coldata.Batch { type projBitandDatumDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projBitandDatumDatumOp) Next() coldata.Batch { @@ -1907,7 +1906,7 @@ func (p projBitorInt64Int64Op) Next() coldata.Batch { type projBitorDatumDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projBitorDatumDatumOp) Next() coldata.Batch { @@ -2893,7 +2892,7 @@ func (p projBitxorInt64Int64Op) Next() coldata.Batch { type projBitxorDatumDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projBitxorDatumDatumOp) Next() coldata.Batch { @@ -3995,7 +3994,7 @@ func (p projPlusInt16DecimalOp) Next() coldata.Batch { type projPlusInt16DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusInt16DatumOp) Next() coldata.Batch { @@ -4623,7 +4622,7 @@ func (p projPlusInt32DecimalOp) Next() coldata.Batch { type projPlusInt32DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusInt32DatumOp) Next() coldata.Batch { @@ -5251,7 +5250,7 @@ func (p projPlusInt64DecimalOp) Next() coldata.Batch { type projPlusInt64DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusInt64DatumOp) Next() coldata.Batch { @@ -5803,7 +5802,7 @@ func (p projPlusIntervalIntervalOp) Next() coldata.Batch { type projPlusIntervalDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusIntervalDatumOp) Next() coldata.Batch { @@ -5943,7 +5942,7 @@ func (p projPlusIntervalDatumOp) Next() coldata.Batch { type projPlusDatumIntervalOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusDatumIntervalOp) Next() coldata.Batch { @@ -6083,7 +6082,7 @@ func (p projPlusDatumIntervalOp) Next() coldata.Batch { type projPlusDatumInt16Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusDatumInt16Op) Next() coldata.Batch { @@ -6223,7 +6222,7 @@ func (p projPlusDatumInt16Op) Next() coldata.Batch { type projPlusDatumInt32Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusDatumInt32Op) Next() coldata.Batch { @@ -6363,7 +6362,7 @@ func (p projPlusDatumInt32Op) Next() coldata.Batch { type projPlusDatumInt64Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projPlusDatumInt64Op) Next() coldata.Batch { @@ -7483,7 +7482,7 @@ func (p projMinusInt16DecimalOp) Next() coldata.Batch { type projMinusInt16DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusInt16DatumOp) Next() coldata.Batch { @@ -8111,7 +8110,7 @@ func (p projMinusInt32DecimalOp) Next() coldata.Batch { type projMinusInt32DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusInt32DatumOp) Next() coldata.Batch { @@ -8739,7 +8738,7 @@ func (p projMinusInt64DecimalOp) Next() coldata.Batch { type projMinusInt64DatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusInt64DatumOp) Next() coldata.Batch { @@ -9283,7 +9282,7 @@ func (p projMinusIntervalIntervalOp) Next() coldata.Batch { type projMinusIntervalDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusIntervalDatumOp) Next() coldata.Batch { @@ -9861,7 +9860,7 @@ func (p projMinusJSONInt64Op) Next() coldata.Batch { type projMinusDatumDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumDatumOp) Next() coldata.Batch { @@ -9983,7 +9982,7 @@ func (p projMinusDatumDatumOp) Next() coldata.Batch { type projMinusDatumIntervalOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumIntervalOp) Next() coldata.Batch { @@ -10123,7 +10122,7 @@ func (p projMinusDatumIntervalOp) Next() coldata.Batch { type projMinusDatumBytesOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumBytesOp) Next() coldata.Batch { @@ -10261,7 +10260,7 @@ func (p projMinusDatumBytesOp) Next() coldata.Batch { type projMinusDatumInt16Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumInt16Op) Next() coldata.Batch { @@ -10401,7 +10400,7 @@ func (p projMinusDatumInt16Op) Next() coldata.Batch { type projMinusDatumInt32Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumInt32Op) Next() coldata.Batch { @@ -10541,7 +10540,7 @@ func (p projMinusDatumInt32Op) Next() coldata.Batch { type projMinusDatumInt64Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projMinusDatumInt64Op) Next() coldata.Batch { @@ -23517,7 +23516,7 @@ func (p projConcatJSONJSONOp) Next() coldata.Batch { type projConcatDatumDatumOp struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projConcatDatumDatumOp) Next() coldata.Batch { @@ -24719,7 +24718,7 @@ func (p projLShiftInt64Int64Op) Next() coldata.Batch { type projLShiftDatumInt16Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projLShiftDatumInt16Op) Next() coldata.Batch { @@ -24859,7 +24858,7 @@ func (p projLShiftDatumInt16Op) Next() coldata.Batch { type projLShiftDatumInt32Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projLShiftDatumInt32Op) Next() coldata.Batch { @@ -24999,7 +24998,7 @@ func (p projLShiftDatumInt32Op) Next() coldata.Batch { type projLShiftDatumInt64Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projLShiftDatumInt64Op) Next() coldata.Batch { @@ -26219,7 +26218,7 @@ func (p projRShiftInt64Int64Op) Next() coldata.Batch { type projRShiftDatumInt16Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projRShiftDatumInt16Op) Next() coldata.Batch { @@ -26359,7 +26358,7 @@ func (p projRShiftDatumInt16Op) Next() coldata.Batch { type projRShiftDatumInt32Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projRShiftDatumInt32Op) Next() coldata.Batch { @@ -26499,7 +26498,7 @@ func (p projRShiftDatumInt32Op) Next() coldata.Batch { type projRShiftDatumInt64Op struct { projOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper } func (p projRShiftDatumInt64Op) Next() coldata.Batch { @@ -56277,7 +56276,7 @@ func GetProjectionOperator( case -1: default: op := &projBitandDatumDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56347,7 +56346,7 @@ func GetProjectionOperator( case -1: default: op := &projBitorDatumDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56417,7 +56416,7 @@ func GetProjectionOperator( case -1: default: op := &projBitxorDatumDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56481,7 +56480,7 @@ func GetProjectionOperator( case -1: default: op := &projPlusInt16DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56512,7 +56511,7 @@ func GetProjectionOperator( case -1: default: op := &projPlusInt32DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56544,7 +56543,7 @@ func GetProjectionOperator( case -1: default: op := &projPlusInt64DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56601,7 +56600,7 @@ func GetProjectionOperator( case -1: default: op := &projPlusIntervalDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56616,23 +56615,23 @@ func GetProjectionOperator( case -1: default: op := &projPlusDatumIntervalOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: switch rightType.Width() { case 16: op := &projPlusDatumInt16Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projPlusDatumInt32Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: op := &projPlusDatumInt64Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56696,7 +56695,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusInt16DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56727,7 +56726,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusInt32DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56759,7 +56758,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusInt64DatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56816,7 +56815,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusIntervalDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -56858,7 +56857,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusDatumDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntervalFamily: @@ -56866,7 +56865,7 @@ func GetProjectionOperator( case -1: default: op := &projMinusDatumIntervalOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.BytesFamily: @@ -56874,23 +56873,23 @@ func GetProjectionOperator( case -1: default: op := &projMinusDatumBytesOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: switch rightType.Width() { case 16: op := &projMinusDatumInt16Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projMinusDatumInt32Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: op := &projMinusDatumInt64Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -57617,7 +57616,7 @@ func GetProjectionOperator( case -1: default: op := &projConcatDatumDatumOp{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -57686,16 +57685,16 @@ func GetProjectionOperator( switch rightType.Width() { case 16: op := &projLShiftDatumInt16Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projLShiftDatumInt32Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: op := &projLShiftDatumInt64Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -57764,16 +57763,16 @@ func GetProjectionOperator( switch rightType.Width() { case 16: op := &projRShiftDatumInt16Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projRShiftDatumInt32Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: op := &projRShiftDatumInt64Op{projOpBase: projOpBase} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } diff --git a/pkg/sql/colexec/colexecproj/proj_non_const_ops_tmpl.go b/pkg/sql/colexec/colexecproj/proj_non_const_ops_tmpl.go index 008b6afef1c2..27418d4ab53c 100644 --- a/pkg/sql/colexec/colexecproj/proj_non_const_ops_tmpl.go +++ b/pkg/sql/colexec/colexecproj/proj_non_const_ops_tmpl.go @@ -28,7 +28,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexeccmp" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" @@ -90,7 +89,7 @@ type projOpBase struct { type _OP_NAME struct { projOpBase // {{if .NeedsBinaryOverloadHelper}} - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper // {{end}} } @@ -99,7 +98,7 @@ func (p _OP_NAME) Next() coldata.Batch { // {{/* // In order to inline the templated code of the binary overloads // operating on datums, we need to have a `_overloadHelper` local - // variable of type `colexecbase.BinaryOverloadHelper`. + // variable of type `colexecutils.BinaryOverloadHelper`. // */}} _overloadHelper := p.BinaryOverloadHelper // {{end}} @@ -271,7 +270,7 @@ func GetProjectionOperator( case _RIGHT_TYPE_WIDTH: op := &_OP_NAME{projOpBase: projOpBase} // {{if .NeedsBinaryOverloadHelper}} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} // {{end}} return op, nil // {{end}} diff --git a/pkg/sql/colexec/colexecprojconst/BUILD.bazel b/pkg/sql/colexec/colexecprojconst/BUILD.bazel index fec818e7ff00..c12163c28ab5 100644 --- a/pkg/sql/colexec/colexecprojconst/BUILD.bazel +++ b/pkg/sql/colexec/colexecprojconst/BUILD.bazel @@ -19,7 +19,6 @@ go_library( "//pkg/col/typeconv", # keep "//pkg/server/telemetry", # keep "//pkg/sql/colconv", # keep - "//pkg/sql/colexec/colexecbase", # keep "//pkg/sql/colexec/colexeccmp", "//pkg/sql/colexec/colexecutils", "//pkg/sql/colexec/execgen", # keep @@ -81,6 +80,7 @@ disallowed_imports_test( [ "//pkg/sql/colexec", "//pkg/sql/colexec/colexecagg", + "//pkg/sql/colexec/colexecbase", "//pkg/sql/colexec/colexechash", "//pkg/sql/colexec/colexecjoin", "//pkg/sql/colexec/colexecproj", diff --git a/pkg/sql/colexec/colexecprojconst/proj_const_left_ops.eg.go b/pkg/sql/colexec/colexecprojconst/proj_const_left_ops.eg.go index 2a0d62bd0d08..67a4bc2c749c 100644 --- a/pkg/sql/colexec/colexecprojconst/proj_const_left_ops.eg.go +++ b/pkg/sql/colexec/colexecprojconst/proj_const_left_ops.eg.go @@ -20,7 +20,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/colexecop" @@ -839,7 +838,7 @@ func (p projBitandInt64ConstInt64Op) Next() coldata.Batch { type projBitandDatumConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -1747,7 +1746,7 @@ func (p projBitorInt64ConstInt64Op) Next() coldata.Batch { type projBitorDatumConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -2655,7 +2654,7 @@ func (p projBitxorInt64ConstInt64Op) Next() coldata.Batch { type projBitxorDatumConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -3687,7 +3686,7 @@ func (p projPlusInt16ConstDecimalOp) Next() coldata.Batch { type projPlusInt16ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -4277,7 +4276,7 @@ func (p projPlusInt32ConstDecimalOp) Next() coldata.Batch { type projPlusInt32ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -4867,7 +4866,7 @@ func (p projPlusInt64ConstDecimalOp) Next() coldata.Batch { type projPlusInt64ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -5381,7 +5380,7 @@ func (p projPlusIntervalConstIntervalOp) Next() coldata.Batch { type projPlusIntervalConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg duration.Duration } @@ -5515,7 +5514,7 @@ func (p projPlusIntervalConstDatumOp) Next() coldata.Batch { type projPlusDatumConstIntervalOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -5647,7 +5646,7 @@ func (p projPlusDatumConstIntervalOp) Next() coldata.Batch { type projPlusDatumConstInt16Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -5779,7 +5778,7 @@ func (p projPlusDatumConstInt16Op) Next() coldata.Batch { type projPlusDatumConstInt32Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -5911,7 +5910,7 @@ func (p projPlusDatumConstInt32Op) Next() coldata.Batch { type projPlusDatumConstInt64Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -6959,7 +6958,7 @@ func (p projMinusInt16ConstDecimalOp) Next() coldata.Batch { type projMinusInt16ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -7549,7 +7548,7 @@ func (p projMinusInt32ConstDecimalOp) Next() coldata.Batch { type projMinusInt32ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -8139,7 +8138,7 @@ func (p projMinusInt64ConstDecimalOp) Next() coldata.Batch { type projMinusInt64ConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -8645,7 +8644,7 @@ func (p projMinusIntervalConstIntervalOp) Next() coldata.Batch { type projMinusIntervalConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg duration.Duration } @@ -9187,7 +9186,7 @@ func (p projMinusJSONConstInt64Op) Next() coldata.Batch { type projMinusDatumConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9303,7 +9302,7 @@ func (p projMinusDatumConstDatumOp) Next() coldata.Batch { type projMinusDatumConstIntervalOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9435,7 +9434,7 @@ func (p projMinusDatumConstIntervalOp) Next() coldata.Batch { type projMinusDatumConstBytesOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9567,7 +9566,7 @@ func (p projMinusDatumConstBytesOp) Next() coldata.Batch { type projMinusDatumConstInt16Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9699,7 +9698,7 @@ func (p projMinusDatumConstInt16Op) Next() coldata.Batch { type projMinusDatumConstInt32Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9831,7 +9830,7 @@ func (p projMinusDatumConstInt32Op) Next() coldata.Batch { type projMinusDatumConstInt64Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -21995,7 +21994,7 @@ func (p projConcatJSONConstJSONOp) Next() coldata.Batch { type projConcatDatumConstDatumOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -23119,7 +23118,7 @@ func (p projLShiftInt64ConstInt64Op) Next() coldata.Batch { type projLShiftDatumConstInt16Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -23251,7 +23250,7 @@ func (p projLShiftDatumConstInt16Op) Next() coldata.Batch { type projLShiftDatumConstInt32Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -23383,7 +23382,7 @@ func (p projLShiftDatumConstInt32Op) Next() coldata.Batch { type projLShiftDatumConstInt64Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -24523,7 +24522,7 @@ func (p projRShiftInt64ConstInt64Op) Next() coldata.Batch { type projRShiftDatumConstInt16Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -24655,7 +24654,7 @@ func (p projRShiftDatumConstInt16Op) Next() coldata.Batch { type projRShiftDatumConstInt32Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -24787,7 +24786,7 @@ func (p projRShiftDatumConstInt32Op) Next() coldata.Batch { type projRShiftDatumConstInt64Op struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -26387,7 +26386,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26487,7 +26486,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26587,7 +26586,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26678,7 +26677,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26724,7 +26723,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26771,7 +26770,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26843,7 +26842,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(duration.Duration), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26861,7 +26860,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: @@ -26871,14 +26870,14 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projPlusDatumConstInt32Op{ projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -26886,7 +26885,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -26977,7 +26976,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -27023,7 +27022,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -27070,7 +27069,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -27142,7 +27141,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: c.(duration.Duration), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -27199,7 +27198,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntervalFamily: @@ -27210,7 +27209,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.BytesFamily: @@ -27221,7 +27220,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: @@ -27231,14 +27230,14 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projMinusDatumConstInt32Op{ projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -27246,7 +27245,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -28279,7 +28278,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -28378,14 +28377,14 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projLShiftDatumConstInt32Op{ projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -28393,7 +28392,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -28492,14 +28491,14 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projRShiftDatumConstInt32Op{ projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -28507,7 +28506,7 @@ func GetProjectionLConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } diff --git a/pkg/sql/colexec/colexecprojconst/proj_const_ops_tmpl.go b/pkg/sql/colexec/colexecprojconst/proj_const_ops_tmpl.go index fe878c65bd98..36f4ba697b6c 100644 --- a/pkg/sql/colexec/colexecprojconst/proj_const_ops_tmpl.go +++ b/pkg/sql/colexec/colexecprojconst/proj_const_ops_tmpl.go @@ -28,7 +28,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexeccmp" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" @@ -86,7 +85,7 @@ func _ASSIGN(_, _, _, _, _, _ interface{}) { type _OP_CONST_NAME struct { projConstOpBase // {{if .NeedsBinaryOverloadHelper}} - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper // {{end}} // {{if _IS_CONST_LEFT}} constArg _L_GO_TYPE @@ -100,7 +99,7 @@ func (p _OP_CONST_NAME) Next() coldata.Batch { // {{/* // In order to inline the templated code of the binary overloads // operating on datums, we need to have a `_overloadHelper` local - // variable of type `colexecbase.BinaryOverloadHelper`. + // variable of type `colexecutils.BinaryOverloadHelper`. // */}} _overloadHelper := p.BinaryOverloadHelper // {{end}} @@ -311,7 +310,7 @@ func GetProjection_CONST_SIDEConstOperator( // {{end}} } // {{if .NeedsBinaryOverloadHelper}} - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} // {{end}} return op, nil // {{end}} diff --git a/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go b/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go index 64c61155d775..42bf68438d53 100644 --- a/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go +++ b/pkg/sql/colexec/colexecprojconst/proj_const_right_ops.eg.go @@ -21,7 +21,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/server/telemetry" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexeccmp" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" @@ -842,7 +841,7 @@ func (p projBitandInt64Int64ConstOp) Next() coldata.Batch { type projBitandDatumDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -1750,7 +1749,7 @@ func (p projBitorInt64Int64ConstOp) Next() coldata.Batch { type projBitorDatumDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -2658,7 +2657,7 @@ func (p projBitxorInt64Int64ConstOp) Next() coldata.Batch { type projBitxorDatumDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -3690,7 +3689,7 @@ func (p projPlusInt16DecimalConstOp) Next() coldata.Batch { type projPlusInt16DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -4278,7 +4277,7 @@ func (p projPlusInt32DecimalConstOp) Next() coldata.Batch { type projPlusInt32DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -4866,7 +4865,7 @@ func (p projPlusInt64DecimalConstOp) Next() coldata.Batch { type projPlusInt64DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -5378,7 +5377,7 @@ func (p projPlusIntervalIntervalConstOp) Next() coldata.Batch { type projPlusIntervalDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -5510,7 +5509,7 @@ func (p projPlusIntervalDatumConstOp) Next() coldata.Batch { type projPlusDatumIntervalConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg duration.Duration } @@ -5644,7 +5643,7 @@ func (p projPlusDatumIntervalConstOp) Next() coldata.Batch { type projPlusDatumInt16ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -5778,7 +5777,7 @@ func (p projPlusDatumInt16ConstOp) Next() coldata.Batch { type projPlusDatumInt32ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -5912,7 +5911,7 @@ func (p projPlusDatumInt32ConstOp) Next() coldata.Batch { type projPlusDatumInt64ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -6962,7 +6961,7 @@ func (p projMinusInt16DecimalConstOp) Next() coldata.Batch { type projMinusInt16DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -7550,7 +7549,7 @@ func (p projMinusInt32DecimalConstOp) Next() coldata.Batch { type projMinusInt32DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -8138,7 +8137,7 @@ func (p projMinusInt64DecimalConstOp) Next() coldata.Batch { type projMinusInt64DatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -8642,7 +8641,7 @@ func (p projMinusIntervalIntervalConstOp) Next() coldata.Batch { type projMinusIntervalDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9188,7 +9187,7 @@ func (p projMinusJSONInt64ConstOp) Next() coldata.Batch { type projMinusDatumDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -9304,7 +9303,7 @@ func (p projMinusDatumDatumConstOp) Next() coldata.Batch { type projMinusDatumIntervalConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg duration.Duration } @@ -9438,7 +9437,7 @@ func (p projMinusDatumIntervalConstOp) Next() coldata.Batch { type projMinusDatumBytesConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg []byte } @@ -9570,7 +9569,7 @@ func (p projMinusDatumBytesConstOp) Next() coldata.Batch { type projMinusDatumInt16ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -9704,7 +9703,7 @@ func (p projMinusDatumInt16ConstOp) Next() coldata.Batch { type projMinusDatumInt32ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -9838,7 +9837,7 @@ func (p projMinusDatumInt32ConstOp) Next() coldata.Batch { type projMinusDatumInt64ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -22004,7 +22003,7 @@ func (p projConcatJSONJSONConstOp) Next() coldata.Batch { type projConcatDatumDatumConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg interface{} } @@ -23128,7 +23127,7 @@ func (p projLShiftInt64Int64ConstOp) Next() coldata.Batch { type projLShiftDatumInt16ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -23262,7 +23261,7 @@ func (p projLShiftDatumInt16ConstOp) Next() coldata.Batch { type projLShiftDatumInt32ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -23396,7 +23395,7 @@ func (p projLShiftDatumInt32ConstOp) Next() coldata.Batch { type projLShiftDatumInt64ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -24538,7 +24537,7 @@ func (p projRShiftInt64Int64ConstOp) Next() coldata.Batch { type projRShiftDatumInt16ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int16 } @@ -24672,7 +24671,7 @@ func (p projRShiftDatumInt16ConstOp) Next() coldata.Batch { type projRShiftDatumInt32ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int32 } @@ -24806,7 +24805,7 @@ func (p projRShiftDatumInt32ConstOp) Next() coldata.Batch { type projRShiftDatumInt64ConstOp struct { projConstOpBase - colexecbase.BinaryOverloadHelper + colexecutils.BinaryOverloadHelper constArg int64 } @@ -53096,7 +53095,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53196,7 +53195,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53296,7 +53295,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53387,7 +53386,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53433,7 +53432,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53480,7 +53479,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53552,7 +53551,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53570,7 +53569,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(duration.Duration), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: @@ -53580,14 +53579,14 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projPlusDatumInt32ConstOp{ projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -53595,7 +53594,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53686,7 +53685,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53732,7 +53731,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53779,7 +53778,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53851,7 +53850,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -53908,7 +53907,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntervalFamily: @@ -53919,7 +53918,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(duration.Duration), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.BytesFamily: @@ -53930,7 +53929,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.([]byte), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } case types.IntFamily: @@ -53940,14 +53939,14 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projMinusDatumInt32ConstOp{ projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -53955,7 +53954,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -54988,7 +54987,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: constArg, } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -55087,14 +55086,14 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projLShiftDatumInt32ConstOp{ projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -55102,7 +55101,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } @@ -55201,14 +55200,14 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int16), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case 32: op := &projRShiftDatumInt32ConstOp{ projConstOpBase: projConstOpBase, constArg: c.(int32), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil case -1: default: @@ -55216,7 +55215,7 @@ func GetProjectionRConstOperator( projConstOpBase: projConstOpBase, constArg: c.(int64), } - op.BinaryOverloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} + op.BinaryOverloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binFn, EvalCtx: evalCtx} return op, nil } } diff --git a/pkg/sql/colexec/colexecutils/BUILD.bazel b/pkg/sql/colexec/colexecutils/BUILD.bazel index 9fe4edc20e45..6063fe084168 100644 --- a/pkg/sql/colexec/colexecutils/BUILD.bazel +++ b/pkg/sql/colexec/colexecutils/BUILD.bazel @@ -7,6 +7,7 @@ go_library( "cancel_checker.go", "deselector.go", "operator.go", + "overloads_bin_util.go", "spilling_buffer.go", "spilling_queue.go", "utils.go", @@ -19,6 +20,7 @@ go_library( "//pkg/sql/colexecerror", "//pkg/sql/colexecop", "//pkg/sql/colmem", + "//pkg/sql/sem/tree", "//pkg/sql/sqlerrors", "//pkg/sql/types", "//pkg/util", diff --git a/pkg/sql/colexec/colexecbase/overloads_bin_util.go b/pkg/sql/colexec/colexecutils/overloads_bin_util.go similarity index 97% rename from pkg/sql/colexec/colexecbase/overloads_bin_util.go rename to pkg/sql/colexec/colexecutils/overloads_bin_util.go index b47bd74c529f..35bc920761e7 100644 --- a/pkg/sql/colexec/colexecbase/overloads_bin_util.go +++ b/pkg/sql/colexec/colexecutils/overloads_bin_util.go @@ -8,7 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -package colexecbase +package colexecutils import "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" diff --git a/pkg/sql/colexec/colexecwindow/range_offset_handler.eg.go b/pkg/sql/colexec/colexecwindow/range_offset_handler.eg.go index ec2e18ac7ad8..7771843de150 100644 --- a/pkg/sql/colexec/colexecwindow/range_offset_handler.eg.go +++ b/pkg/sql/colexec/colexecwindow/range_offset_handler.eg.go @@ -19,7 +19,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/execinfra" @@ -143,7 +142,7 @@ func newRangeOffsetHandler( } _, binOp, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -222,7 +221,7 @@ func newRangeOffsetHandler( } binOp, _, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -304,7 +303,7 @@ func newRangeOffsetHandler( } _, binOp, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -383,7 +382,7 @@ func newRangeOffsetHandler( } binOp, _, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -468,7 +467,7 @@ func newRangeOffsetHandler( } binOp, _, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -547,7 +546,7 @@ func newRangeOffsetHandler( } _, binOp, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -629,7 +628,7 @@ func newRangeOffsetHandler( } binOp, _, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -708,7 +707,7 @@ func newRangeOffsetHandler( } _, binOp, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} return op } } @@ -1865,7 +1864,7 @@ func (h *rangeHandlerOffsetPrecedingStartAscTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetPrecedingStartAscDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -2918,7 +2917,7 @@ func (h *rangeHandlerOffsetPrecedingStartDescTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetPrecedingStartDescDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -4296,7 +4295,7 @@ func (h *rangeHandlerOffsetPrecedingEndAscTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetPrecedingEndAscDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -5502,7 +5501,7 @@ func (h *rangeHandlerOffsetPrecedingEndDescTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetPrecedingEndDescDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -6761,7 +6760,7 @@ func (h *rangeHandlerOffsetFollowingStartAscTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetFollowingStartAscDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -7814,7 +7813,7 @@ func (h *rangeHandlerOffsetFollowingStartDescTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetFollowingStartDescDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -9192,7 +9191,7 @@ func (h *rangeHandlerOffsetFollowingEndAscTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetFollowingEndAscDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } @@ -10398,7 +10397,7 @@ func (h *rangeHandlerOffsetFollowingEndDescTimestamp) close() { // the start or end bound for each row when in RANGE mode with an offset. type rangeHandlerOffsetFollowingEndDescDatum struct { rangeOffsetHandlerBase - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper offset tree.Datum } diff --git a/pkg/sql/colexec/colexecwindow/range_offset_handler_tmpl.go b/pkg/sql/colexec/colexecwindow/range_offset_handler_tmpl.go index 623773a50bf1..c7dcb9b4c37f 100644 --- a/pkg/sql/colexec/colexecwindow/range_offset_handler_tmpl.go +++ b/pkg/sql/colexec/colexecwindow/range_offset_handler_tmpl.go @@ -29,7 +29,6 @@ import ( "github.com/cockroachdb/cockroach/pkg/col/coldataext" "github.com/cockroachdb/cockroach/pkg/col/typeconv" "github.com/cockroachdb/cockroach/pkg/sql/colconv" - "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecbase" "github.com/cockroachdb/cockroach/pkg/sql/colexec/colexecutils" "github.com/cockroachdb/cockroach/pkg/sql/colexecerror" "github.com/cockroachdb/cockroach/pkg/sql/execinfra" @@ -126,7 +125,7 @@ func newRangeOffsetHandler( _, binOp, _ := tree.WindowFrameRangeOps{}.LookupImpl( ordColType, getOffsetType(ordColType)) // {{end}} - op.overloadHelper = colexecbase.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} + op.overloadHelper = colexecutils.BinaryOverloadHelper{BinFn: binOp.Fn, EvalCtx: evalCtx} // {{end}} return op // {{end}} @@ -162,7 +161,7 @@ type rangeOffsetHandlerBase struct { type _OP_STRING struct { rangeOffsetHandlerBase // {{if eq .VecMethod "Datum"}} - overloadHelper colexecbase.BinaryOverloadHelper + overloadHelper colexecutils.BinaryOverloadHelper // {{end}} offset _OFFSET_GOTYPE } @@ -195,7 +194,7 @@ func (h *_OP_STRING) getIdx(ctx context.Context, currRow, lastIdx int) (idx int) // {{/* // In order to inline the templated code of the binary overloads // operating on datums, we need to have a `_overloadHelper` local - // variable of type `colexecbase.BinaryOverloadHelper`. This is + // variable of type `colexecutils.BinaryOverloadHelper`. This is // necessary when dealing with Time and TimeTZ columns since they aren't // yet handled natively. // */}} diff --git a/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go b/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go index 4bfb4251dfd0..21f067226667 100644 --- a/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go +++ b/pkg/sql/colexec/execgen/cmd/execgen/overloads_base.go @@ -315,7 +315,7 @@ type twoArgsResolvedOverload struct { } // NeedsBinaryOverloadHelper returns true iff the overload is such that it needs -// access to colexecbase.BinaryOverloadHelper. +// access to colexecutils.BinaryOverloadHelper. func (o *twoArgsResolvedOverload) NeedsBinaryOverloadHelper() bool { return o.kind == binaryOverload && o.Right.RetVecMethod == "Datum" } diff --git a/pkg/sql/exec_util.go b/pkg/sql/exec_util.go index 7b064cb9d7db..df577bb5f355 100644 --- a/pkg/sql/exec_util.go +++ b/pkg/sql/exec_util.go @@ -76,8 +76,8 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgwirecancel" "github.com/cockroachdb/cockroach/pkg/sql/physicalplan" "github.com/cockroachdb/cockroach/pkg/sql/querycache" - "github.com/cockroachdb/cockroach/pkg/sql/row" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/scheduledlogging" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scexec" "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scrun" @@ -1188,8 +1188,8 @@ type ExecutorConfig struct { SchemaChangerMetrics *SchemaChangerMetrics FeatureFlagMetrics *featureflag.DenialMetrics - RowMetrics *row.Metrics - InternalRowMetrics *row.Metrics + RowMetrics *rowinfra.Metrics + InternalRowMetrics *rowinfra.Metrics TestingKnobs ExecutorTestingKnobs MigrationTestingKnobs *migration.TestingKnobs @@ -3324,18 +3324,18 @@ func TestingDescsTxn( return DescsTxn(ctx, &execCfg, f) } -// NewRowMetrics creates a row.Metrics struct for either internal or user +// NewRowMetrics creates a rowinfra.Metrics struct for either internal or user // queries. -func NewRowMetrics(internal bool) row.Metrics { - return row.Metrics{ - MaxRowSizeLogCount: metric.NewCounter(getMetricMeta(row.MetaMaxRowSizeLog, internal)), - MaxRowSizeErrCount: metric.NewCounter(getMetricMeta(row.MetaMaxRowSizeErr, internal)), +func NewRowMetrics(internal bool) rowinfra.Metrics { + return rowinfra.Metrics{ + MaxRowSizeLogCount: metric.NewCounter(getMetricMeta(rowinfra.MetaMaxRowSizeLog, internal)), + MaxRowSizeErrCount: metric.NewCounter(getMetricMeta(rowinfra.MetaMaxRowSizeErr, internal)), } } -// GetRowMetrics returns the proper RowMetrics for either internal or user +// GetRowMetrics returns the proper rowinfra.Metrics for either internal or user // queries. -func (cfg *ExecutorConfig) GetRowMetrics(internal bool) *row.Metrics { +func (cfg *ExecutorConfig) GetRowMetrics(internal bool) *rowinfra.Metrics { if internal { return cfg.InternalRowMetrics } diff --git a/pkg/sql/execinfra/BUILD.bazel b/pkg/sql/execinfra/BUILD.bazel index f10ee45c53d0..a60c2ef6bf7e 100644 --- a/pkg/sql/execinfra/BUILD.bazel +++ b/pkg/sql/execinfra/BUILD.bazel @@ -47,9 +47,9 @@ go_library( "//pkg/sql/catalog/descs", "//pkg/sql/catalog/tabledesc", "//pkg/sql/execinfrapb", - "//pkg/sql/row", "//pkg/sql/rowenc", "//pkg/sql/rowenc/valueside", + "//pkg/sql/rowinfra", "//pkg/sql/sem/builtins", "//pkg/sql/sem/tree", "//pkg/sql/sessiondata", @@ -123,6 +123,7 @@ disallowed_imports_test( "//pkg/sql/colexec", "//pkg/sql/colflow", "//pkg/sql/flowinfra", + "//pkg/sql/row", "//pkg/sql/rowexec", "//pkg/sql/rowflow", ], diff --git a/pkg/sql/execinfra/server_config.go b/pkg/sql/execinfra/server_config.go index 8e5a4c7bcaf3..4d323f0d1718 100644 --- a/pkg/sql/execinfra/server_config.go +++ b/pkg/sql/execinfra/server_config.go @@ -31,7 +31,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/rpc/nodedialer" "github.com/cockroachdb/cockroach/pkg/settings/cluster" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs" - "github.com/cockroachdb/cockroach/pkg/sql/row" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/sql/sqlliveness" "github.com/cockroachdb/cockroach/pkg/sql/sqlutil" @@ -120,8 +120,8 @@ type ServerConfig struct { ParentDiskMonitor *mon.BytesMonitor Metrics *DistSQLMetrics - RowMetrics *row.Metrics - InternalRowMetrics *row.Metrics + RowMetrics *rowinfra.Metrics + InternalRowMetrics *rowinfra.Metrics // SQLLivenessReader provides access to reading the liveness of sessions. SQLLivenessReader sqlliveness.Reader @@ -316,9 +316,9 @@ func GetWorkMemLimit(flowCtx *FlowCtx) int64 { return flowCtx.EvalCtx.SessionData().WorkMemLimit } -// GetRowMetrics returns the proper RowMetrics for either internal or user +// GetRowMetrics returns the proper rowinfra.Metrics for either internal or user // queries. -func (flowCtx *FlowCtx) GetRowMetrics() *row.Metrics { +func (flowCtx *FlowCtx) GetRowMetrics() *rowinfra.Metrics { if flowCtx.EvalCtx.SessionData().Internal { return flowCtx.Cfg.InternalRowMetrics } diff --git a/pkg/sql/row/BUILD.bazel b/pkg/sql/row/BUILD.bazel index d47cb7cceb0c..51141d8d2400 100644 --- a/pkg/sql/row/BUILD.bazel +++ b/pkg/sql/row/BUILD.bazel @@ -14,7 +14,6 @@ go_library( "kv_batch_streamer.go", "kv_fetcher.go", "locking.go", - "metrics.go", "partial_index.go", "row_converter.go", "truncate.go", @@ -66,7 +65,6 @@ go_library( "//pkg/util/hlc", "//pkg/util/log", "//pkg/util/log/eventpb", - "//pkg/util/metric", "//pkg/util/mon", "//pkg/util/protoutil", "//pkg/util/timeutil", diff --git a/pkg/sql/row/deleter.go b/pkg/sql/row/deleter.go index 7c421066210c..3646c8eb067c 100644 --- a/pkg/sql/row/deleter.go +++ b/pkg/sql/row/deleter.go @@ -20,6 +20,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util/log" ) @@ -47,7 +48,7 @@ func MakeDeleter( requestedCols []catalog.Column, sv *settings.Values, internal bool, - metrics *Metrics, + metrics *rowinfra.Metrics, ) Deleter { indexes := tableDesc.DeletableNonPrimaryIndexes() diff --git a/pkg/sql/row/helper.go b/pkg/sql/row/helper.go index 588102b89a87..0c734429ae5a 100644 --- a/pkg/sql/row/helper.go +++ b/pkg/sql/row/helper.go @@ -26,6 +26,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" "github.com/cockroachdb/cockroach/pkg/sql/rowenc/rowencpb" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util" "github.com/cockroachdb/cockroach/pkg/util/encoding" @@ -109,7 +110,7 @@ type rowHelper struct { // Used to check row size. maxRowSizeLog, maxRowSizeErr uint32 internal bool - metrics *Metrics + metrics *rowinfra.Metrics } func newRowHelper( @@ -118,7 +119,7 @@ func newRowHelper( indexes []catalog.Index, sv *settings.Values, internal bool, - metrics *Metrics, + metrics *rowinfra.Metrics, ) rowHelper { rh := rowHelper{ Codec: codec, diff --git a/pkg/sql/row/inserter.go b/pkg/sql/row/inserter.go index 407970067441..965e6704b79b 100644 --- a/pkg/sql/row/inserter.go +++ b/pkg/sql/row/inserter.go @@ -20,6 +20,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/settings" "github.com/cockroachdb/cockroach/pkg/sql/catalog" "github.com/cockroachdb/cockroach/pkg/sql/rowenc/valueside" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/errors" @@ -51,7 +52,7 @@ func MakeInserter( alloc *tree.DatumAlloc, sv *settings.Values, internal bool, - metrics *Metrics, + metrics *rowinfra.Metrics, ) (Inserter, error) { ri := Inserter{ Helper: newRowHelper( diff --git a/pkg/sql/row/row_converter.go b/pkg/sql/row/row_converter.go index 08cda6320102..6f743a2a87ee 100644 --- a/pkg/sql/row/row_converter.go +++ b/pkg/sql/row/row_converter.go @@ -20,6 +20,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/catalog/descs" "github.com/cockroachdb/cockroach/pkg/sql/catalog/schemaexpr" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/builtins" "github.com/cockroachdb/cockroach/pkg/sql/sem/transform" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" @@ -294,7 +295,7 @@ func NewDatumRowConverter( evalCtx *tree.EvalContext, kvCh chan<- KVBatch, seqChunkProvider *SeqChunkProvider, - metrics *Metrics, + metrics *rowinfra.Metrics, ) (*DatumRowConverter, error) { c := &DatumRowConverter{ tableDesc: tableDesc, diff --git a/pkg/sql/row/updater.go b/pkg/sql/row/updater.go index f39f7d51dece..288463fd1537 100644 --- a/pkg/sql/row/updater.go +++ b/pkg/sql/row/updater.go @@ -23,6 +23,7 @@ import ( "github.com/cockroachdb/cockroach/pkg/sql/catalog/descpb" "github.com/cockroachdb/cockroach/pkg/sql/rowenc" "github.com/cockroachdb/cockroach/pkg/sql/rowenc/valueside" + "github.com/cockroachdb/cockroach/pkg/sql/rowinfra" "github.com/cockroachdb/cockroach/pkg/sql/sem/tree" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/unique" @@ -87,7 +88,7 @@ func MakeUpdater( alloc *tree.DatumAlloc, sv *settings.Values, internal bool, - metrics *Metrics, + metrics *rowinfra.Metrics, ) (Updater, error) { if requestedCols == nil { return Updater{}, errors.AssertionFailedf("requestedCols is nil in MakeUpdater") diff --git a/pkg/sql/rowinfra/BUILD.bazel b/pkg/sql/rowinfra/BUILD.bazel index 7331df1e5690..af1012c14db0 100644 --- a/pkg/sql/rowinfra/BUILD.bazel +++ b/pkg/sql/rowinfra/BUILD.bazel @@ -2,7 +2,11 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library") go_library( name = "rowinfra", - srcs = ["base.go"], + srcs = [ + "base.go", + "metrics.go", + ], importpath = "github.com/cockroachdb/cockroach/pkg/sql/rowinfra", visibility = ["//visibility:public"], + deps = ["//pkg/util/metric"], ) diff --git a/pkg/sql/row/metrics.go b/pkg/sql/rowinfra/metrics.go similarity index 98% rename from pkg/sql/row/metrics.go rename to pkg/sql/rowinfra/metrics.go index 6c356a80c285..b93d43e242d2 100644 --- a/pkg/sql/row/metrics.go +++ b/pkg/sql/rowinfra/metrics.go @@ -8,7 +8,7 @@ // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. -package row +package rowinfra import "github.com/cockroachdb/cockroach/pkg/util/metric"