Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xzhangxian1008 committed Nov 7, 2023
1 parent 585468f commit cea5d2c
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 25 deletions.
4 changes: 2 additions & 2 deletions pkg/executor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ go_library(
"//pkg/executor/lockstats",
"//pkg/executor/metrics",
"//pkg/executor/mppcoordmanager",
"//pkg/executor/sort_exec",
"//pkg/executor/sortexec",
"//pkg/expression",
"//pkg/expression/aggregation",
"//pkg/infoschema",
Expand Down Expand Up @@ -380,7 +380,7 @@ go_test(
"//pkg/executor/importer",
"//pkg/executor/internal/builder",
"//pkg/executor/internal/exec",
"//pkg/executor/sort_exec",
"//pkg/executor/sortexec",
"//pkg/expression",
"//pkg/expression/aggregation",
"//pkg/infoschema",
Expand Down
8 changes: 4 additions & 4 deletions pkg/executor/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/pingcap/tidb/pkg/executor/aggfuncs"
"github.com/pingcap/tidb/pkg/executor/aggregate"
"github.com/pingcap/tidb/pkg/executor/internal/exec"
"github.com/pingcap/tidb/pkg/executor/sort_exec"
"github.com/pingcap/tidb/pkg/executor/sortexec"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
"github.com/pingcap/tidb/pkg/parser/ast"
Expand Down Expand Up @@ -1647,7 +1647,7 @@ func prepare4MergeJoin(tc *mergeJoinTestCase, innerDS, outerDS *mockDataSource,

var leftExec, rightExec exec.Executor
if sorted {
leftSortExec := &sort_exec.SortExec{
leftSortExec := &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(tc.ctx, innerDS.Schema(), 3, innerDS),
ByItems: make([]*util.ByItems, 0, len(tc.innerJoinKeyIdx)),
ExecSchema: innerDS.Schema(),
Expand All @@ -1657,7 +1657,7 @@ func prepare4MergeJoin(tc *mergeJoinTestCase, innerDS, outerDS *mockDataSource,
}
leftExec = leftSortExec

rightSortExec := &sort_exec.SortExec{
rightSortExec := &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(tc.ctx, outerDS.Schema(), 4, outerDS),
ByItems: make([]*util.ByItems, 0, len(tc.outerJoinKeyIdx)),
ExecSchema: outerDS.Schema(),
Expand Down Expand Up @@ -1918,7 +1918,7 @@ func benchmarkSortExec(b *testing.B, cas *sortCase) {
ndvs: cas.ndvs,
}
dataSource := buildMockDataSource(opt)
executor := &sort_exec.SortExec{
executor := &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(cas.ctx, dataSource.Schema(), 4, dataSource),
ByItems: make([]*util.ByItems, 0, len(cas.orderByIdx)),
ExecSchema: dataSource.Schema(),
Expand Down
10 changes: 5 additions & 5 deletions pkg/executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import (
"github.com/pingcap/tidb/pkg/executor/internal/vecgroupchecker"
"github.com/pingcap/tidb/pkg/executor/lockstats"
executor_metrics "github.com/pingcap/tidb/pkg/executor/metrics"
"github.com/pingcap/tidb/pkg/executor/sort_exec"
"github.com/pingcap/tidb/pkg/executor/sortexec"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
"github.com/pingcap/tidb/pkg/infoschema"
Expand Down Expand Up @@ -1298,7 +1298,7 @@ func (b *executorBuilder) buildTrace(v *plannercore.Trace) exec.Executor {
optimizerTraceTarget: v.OptimizerTraceTarget,
}
if t.format == plannercore.TraceFormatLog && !t.optimizerTrace {
return &sort_exec.SortExec{
return &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(b.ctx, v.Schema(), v.ID(), t),
ByItems: []*plannerutil.ByItems{
{Expr: &expression.Column{
Expand Down Expand Up @@ -2246,7 +2246,7 @@ func (b *executorBuilder) buildSort(v *plannercore.PhysicalSort) exec.Executor {
if b.err != nil {
return nil
}
sortExec := sort_exec.SortExec{
sortExec := sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(b.ctx, v.Schema(), v.ID(), childExec),
ByItems: v.ByItems,
ExecSchema: v.Schema(),
Expand All @@ -2260,13 +2260,13 @@ func (b *executorBuilder) buildTopN(v *plannercore.PhysicalTopN) exec.Executor {
if b.err != nil {
return nil
}
sortExec := sort_exec.SortExec{
sortExec := sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(b.ctx, v.Schema(), v.ID(), childExec),
ByItems: v.ByItems,
ExecSchema: v.Schema(),
}
executor_metrics.ExecutorCounterTopNExec.Inc()
return &sort_exec.TopNExec{
return &sortexec.TopNExec{
SortExec: sortExec,
Limit: &plannercore.PhysicalLimit{Count: v.Count, Offset: v.Offset},
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/pingcap/tidb/pkg/executor/aggregate"
"github.com/pingcap/tidb/pkg/executor/internal/exec"
"github.com/pingcap/tidb/pkg/executor/internal/pdhelper"
"github.com/pingcap/tidb/pkg/executor/sort_exec"
"github.com/pingcap/tidb/pkg/executor/sortexec"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/infoschema"
"github.com/pingcap/tidb/pkg/kv"
Expand Down Expand Up @@ -103,12 +103,12 @@ var (
_ exec.Executor = &ShowDDLExec{}
_ exec.Executor = &ShowDDLJobsExec{}
_ exec.Executor = &ShowDDLJobQueriesExec{}
_ exec.Executor = &sort_exec.SortExec{}
_ exec.Executor = &sortexec.SortExec{}
_ exec.Executor = &aggregate.StreamAggExec{}
_ exec.Executor = &TableDualExec{}
_ exec.Executor = &TableReaderExecutor{}
_ exec.Executor = &TableScanExec{}
_ exec.Executor = &sort_exec.TopNExec{}
_ exec.Executor = &sortexec.TopNExec{}
_ exec.Executor = &UnionExec{}
_ exec.Executor = &FastCheckTableExec{}

Expand Down
6 changes: 3 additions & 3 deletions pkg/executor/executor_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/pingcap/tidb/pkg/executor/aggfuncs"
"github.com/pingcap/tidb/pkg/executor/aggregate"
"github.com/pingcap/tidb/pkg/executor/internal/exec"
"github.com/pingcap/tidb/pkg/executor/sort_exec"
"github.com/pingcap/tidb/pkg/executor/sortexec"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/kv"
plannerutil "github.com/pingcap/tidb/pkg/planner/util"
Expand Down Expand Up @@ -291,7 +291,7 @@ func TestSortSpillDisk(t *testing.T) {
ndvs: cas.ndvs,
}
dataSource := buildMockDataSource(opt)
exe := &sort_exec.SortExec{
exe := &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(cas.ctx, dataSource.Schema(), 0, dataSource),
ByItems: make([]*plannerutil.ByItems, 0, len(cas.orderByIdx)),
ExecSchema: dataSource.Schema(),
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestSortSpillDisk(t *testing.T) {
ndvs: cas.ndvs,
}
dataSource = buildMockDataSource(opt)
exe = &sort_exec.SortExec{
exe = &sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(cas.ctx, dataSource.Schema(), 0, dataSource),
ByItems: make([]*plannerutil.ByItems, 0, len(cas.orderByIdx)),
ExecSchema: dataSource.Schema(),
Expand Down
8 changes: 4 additions & 4 deletions pkg/executor/executor_required_rows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

"github.com/pingcap/tidb/pkg/domain"
"github.com/pingcap/tidb/pkg/executor/internal/exec"
"github.com/pingcap/tidb/pkg/executor/sort_exec"
"github.com/pingcap/tidb/pkg/executor/sortexec"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
"github.com/pingcap/tidb/pkg/parser/ast"
Expand Down Expand Up @@ -279,7 +279,7 @@ func TestSortRequiredRows(t *testing.T) {
}

func buildSortExec(sctx sessionctx.Context, byItems []*util.ByItems, src exec.Executor) exec.Executor {
sortExec := sort_exec.SortExec{
sortExec := sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(sctx, src.Schema(), 0, src),
ByItems: byItems,
ExecSchema: src.Schema(),
Expand Down Expand Up @@ -386,12 +386,12 @@ func TestTopNRequiredRows(t *testing.T) {
}

func buildTopNExec(ctx sessionctx.Context, offset, count int, byItems []*util.ByItems, src exec.Executor) exec.Executor {
sortExec := sort_exec.SortExec{
sortExec := sortexec.SortExec{
BaseExecutor: exec.NewBaseExecutor(ctx, src.Schema(), 0, src),
ByItems: byItems,
ExecSchema: src.Schema(),
}
return &sort_exec.TopNExec{
return &sortexec.TopNExec{
SortExec: sortExec,
Limit: &plannercore.PhysicalLimit{Count: uint64(count), Offset: uint64(offset)},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "sort_exec",
name = "sortexec",
srcs = ["sort.go"],
importpath = "github.com/pingcap/tidb/pkg/executor/sort_exec",
importpath = "github.com/pingcap/tidb/pkg/executor/sortexec",
visibility = ["//visibility:public"],
deps = [
"//pkg/executor/internal/exec",
Expand Down Expand Up @@ -33,3 +33,16 @@ go_test(
"@com_github_stretchr_testify//require",
],
)

go_test(
name = "sortexec_test",
srcs = ["sort_test.go"],
deps = [
"//pkg/config",
"//pkg/sessionctx/variable",
"//pkg/testkit",
"//pkg/util",
"@com_github_pingcap_failpoint//:failpoint",
"@com_github_stretchr_testify//require",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package sort_exec
package sortexec

import (
"container/heap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package sort_exec_test
package sortexec_test

import (
"bytes"
Expand Down

0 comments on commit cea5d2c

Please sign in to comment.