Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
Signed-off-by: AilinKid <[email protected]>
  • Loading branch information
AilinKid committed Apr 7, 2024
1 parent b4b22e3 commit dbfe731
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 16 deletions.
4 changes: 4 additions & 0 deletions pkg/planner/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ go_library(
"pb_to_plan.go",
"physical_plans.go",
"plan.go",
"plan_base.go",
"plan_cache.go",
"plan_cache_lru.go",
"plan_cache_param.go",
Expand Down Expand Up @@ -77,6 +78,7 @@ go_library(
"stats.go",
"stringer.go",
"task.go",
"task_base.go",
"tiflash_selection_late_materialization.go",
"trace.go",
"util.go",
Expand Down Expand Up @@ -117,6 +119,7 @@ go_library(
"//pkg/planner/funcdep",
"//pkg/planner/property",
"//pkg/planner/util",
"//pkg/planner/util/coreusage",
"//pkg/planner/util/debugtrace",
"//pkg/planner/util/fixcontrol",
"//pkg/privilege",
Expand Down Expand Up @@ -249,6 +252,7 @@ go_test(
"//pkg/planner/core/internal",
"//pkg/planner/property",
"//pkg/planner/util",
"//pkg/planner/util/coreusage",
"//pkg/session",
"//pkg/session/types",
"//pkg/sessionctx",
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"cmp"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"math"
"runtime"
"slices"
Expand All @@ -41,6 +40,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/property"
plannerutil "github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/planner/util/debugtrace"
"github.com/pingcap/tidb/pkg/privilege"
"github.com/pingcap/tidb/pkg/sessionctx"
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/plan_cost_ver1.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
package core

import (
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"math"

"github.com/pingcap/errors"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/planner/cardinality"
"github.com/pingcap/tidb/pkg/planner/property"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/sessionctx/variable"
"github.com/pingcap/tidb/pkg/statistics"
"github.com/pingcap/tidb/pkg/util/paging"
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_eliminate_projection.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/failpoint"
"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
)

// canProjectionBeEliminatedLoose checks whether a projection can be eliminated,
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_generate_column_substitute.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package core
import (
"bytes"
"context"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/types"
h "github.com/pingcap/tidb/pkg/util/hint"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_join_elimination.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/util/set"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_join_reorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"slices"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
h "github.com/pingcap/tidb/pkg/util/hint"
"github.com/pingcap/tidb/pkg/util/plancodec"
"github.com/pingcap/tidb/pkg/util/tracing"
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_max_min_eliminate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/ranger"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_partition_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"cmp"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"math"
"slices"
"sort"
Expand All @@ -30,6 +29,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/table"
"github.com/pingcap/tidb/pkg/table/tables"
"github.com/pingcap/tidb/pkg/types"
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_predicate_push_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/kv"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/logutil"
"github.com/pingcap/tidb/pkg/util/ranger"
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_predicate_simplification.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package core
import (
"context"
"errors"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"slices"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
)

// predicateSimplification consolidates different predcicates on a column and its equivalence classes. Initial out is for
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_result_reorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ package core

import (
"context"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
)

/*
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_semi_join_rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ package core

import (
"context"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/expression/aggregation"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
h "github.com/pingcap/tidb/pkg/util/hint"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/rule_topn_push_down.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ import (
"bytes"
"context"
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"

"github.com/pingcap/tidb/pkg/expression"
"github.com/pingcap/tidb/pkg/planner/util"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
)

// pushDownTopNOptimizer pushes down the topN or limit. In the future we will remove the limit from `requiredProperty` in CBO phase.
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/core/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package core

import (
"fmt"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"slices"
"strings"

Expand All @@ -26,6 +25,7 @@ import (
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/parser/mysql"
"github.com/pingcap/tidb/pkg/planner/core/internal/base"
"github.com/pingcap/tidb/pkg/planner/util/coreusage"
"github.com/pingcap/tidb/pkg/sessionctx"
"github.com/pingcap/tidb/pkg/table"
"github.com/pingcap/tidb/pkg/tablecodec"
Expand Down
2 changes: 0 additions & 2 deletions pkg/planner/util/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ go_library(
"byitem.go",
"expression.go",
"misc.go",
"optTracer.go",
"path.go",
],
importpath = "github.com/pingcap/tidb/pkg/planner/util",
Expand All @@ -21,7 +20,6 @@ go_library(
"//pkg/util/collate",
"//pkg/util/ranger",
"//pkg/util/size",
"//pkg/util/tracing",
],
)

Expand Down
12 changes: 12 additions & 0 deletions pkg/planner/util/coreusage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "coreusage",
srcs = [
"costMisc.go",
"optTracer.go",
],
importpath = "github.com/pingcap/tidb/pkg/planner/util/coreusage",
visibility = ["//visibility:public"],
deps = ["//pkg/util/tracing"],
)

0 comments on commit dbfe731

Please sign in to comment.