Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression: generate vecEval methods for all functions to avoid further conflicts #12395

Merged
merged 12 commits into from
Sep 25, 2019
155 changes: 155 additions & 0 deletions expression/builtin_arithmetic_vec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
// Copyright 2019 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package expression

import (
"github.com/pingcap/errors"
"github.com/pingcap/tidb/util/chunk"
)

func (b *builtinArithmeticMultiplyRealSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMultiplyRealSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticDivideDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticDivideDecimalSig) vecEvalDecimal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticModIntSig) vectorized() bool {
return false
}

func (b *builtinArithmeticModIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMinusRealSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMinusRealSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMinusDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMinusDecimalSig) vecEvalDecimal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMinusIntSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMinusIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticModRealSig) vectorized() bool {
return false
}

func (b *builtinArithmeticModRealSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticModDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticModDecimalSig) vecEvalDecimal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticPlusRealSig) vectorized() bool {
return false
}

func (b *builtinArithmeticPlusRealSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMultiplyDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMultiplyDecimalSig) vecEvalDecimal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticIntDivideDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticIntDivideDecimalSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMultiplyIntSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMultiplyIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticDivideRealSig) vectorized() bool {
return false
}

func (b *builtinArithmeticDivideRealSig) vecEvalReal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticIntDivideIntSig) vectorized() bool {
return false
}

func (b *builtinArithmeticIntDivideIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticPlusIntSig) vectorized() bool {
return false
}

func (b *builtinArithmeticPlusIntSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticPlusDecimalSig) vectorized() bool {
return false
}

func (b *builtinArithmeticPlusDecimalSig) vecEvalDecimal(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}

func (b *builtinArithmeticMultiplyIntUnsignedSig) vectorized() bool {
return false
}

func (b *builtinArithmeticMultiplyIntUnsignedSig) vecEvalInt(input *chunk.Chunk, result *chunk.Column) error {
return errors.Errorf("not implemented")
}
43 changes: 43 additions & 0 deletions expression/builtin_arithmetic_vec_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2019 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package expression

import (
"testing"

. "github.com/pingcap/check"
"github.com/pingcap/parser/ast"
)

var vecBuiltinArithmeticCases = map[string][]vecExprBenchCase{
ast.LE: {},
ast.Minus: {},
ast.Div: {},
ast.IntDiv: {},
ast.Mod: {},
ast.Or: {},
ast.Mul: {},
ast.Round: {},
ast.And: {},
ast.Plus: {},
ast.NE: {},
}

func (s *testEvaluatorSuite) TestVectorizedBuiltinArithmeticFunc(c *C) {
testVectorizedBuiltinFunc(c, vecBuiltinArithmeticCases)
}

func BenchmarkVectorizedBuiltinArithmeticFunc(b *testing.B) {
benchmarkVectorizedBuiltinFunc(b, vecBuiltinArithmeticCases)
}
Loading