Skip to content

Commit

Permalink
*: support stream agg on TiKV (pingcap#5725)
Browse files Browse the repository at this point in the history
* *: support stream agg on TiKV
  • Loading branch information
zimulala authored Mar 1, 2018
1 parent 12a1a25 commit bf5cae2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
1 change: 0 additions & 1 deletion kv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ const (
ReqSubTypeSignature = 10003
ReqSubTypeAnalyzeIdx = 10004
ReqSubTypeAnalyzeCol = 10005
ReqSubTypeStreamAgg = 10006
)

// Request represents a kv request.
Expand Down
9 changes: 0 additions & 9 deletions plan/gen_physical_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/pingcap/tidb/ast"
"github.com/pingcap/tidb/expression"
"github.com/pingcap/tidb/expression/aggregation"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/model"
"github.com/pingcap/tidb/mysql"
"github.com/pingcap/tidb/terror"
Expand Down Expand Up @@ -546,14 +545,6 @@ func (la *LogicalAggregation) getStreamAggs(prop *requiredProp) []PhysicalPlan {
if tp == copDoubleReadTaskType {
continue
}
// Now we only support pushing down stream aggregation on mocktikv.
// TODO: Remove it after TiKV supports stream aggregation.
if tp == copSingleReadTaskType {
client := la.ctx.GetClient()
if !client.IsRequestTypeSupported(kv.ReqTypeDAG, kv.ReqSubTypeStreamAgg) {
continue
}
}
childProp := &requiredProp{
taskTp: tp,
cols: keys,
Expand Down
5 changes: 0 additions & 5 deletions store/tikv/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ func (c *CopClient) IsRequestTypeSupported(reqType, subType int64) bool {
return c.supportExpr(tipb.ExprType(subType))
}
case kv.ReqTypeDAG:
// Now we only support pushing down stream aggregation on mocktikv.
// TODO: Remove it after TiKV supports stream aggregation.
if subType == kv.ReqSubTypeStreamAgg {
return c.store.mock
}
return c.supportExpr(tipb.ExprType(subType))
case kv.ReqTypeAnalyze:
return true
Expand Down
13 changes: 9 additions & 4 deletions util/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ var (
TiDBGitHash = "None"
TiDBGitBranch = "None"
GoVersion = "None"
// TiKVMinVersion is the minimum version of TiKV that can be compatible with the current TiDB.
TiKVMinVersion = "1.1.0-dev.1"
)

// PrintTiDBInfo prints the TiDB version information.
Expand All @@ -39,6 +41,7 @@ func PrintTiDBInfo() {
log.Infof("Git Branch: %s", TiDBGitBranch)
log.Infof("UTC Build Time: %s", TiDBBuildTS)
log.Infof("GoVersion: %s", GoVersion)
log.Infof("TiKV Min Version: %s", TiKVMinVersion)
configJSON, err := json.Marshal(config.GetGlobalConfig())
if err != nil {
panic(err)
Expand All @@ -48,16 +51,18 @@ func PrintTiDBInfo() {

// PrintRawTiDBInfo prints the TiDB version information without log info.
func PrintRawTiDBInfo() {
fmt.Println("Release Version:", mysql.TiDBReleaseVersion)
fmt.Println("Git Commit Hash:", TiDBGitHash)
fmt.Println("Git Commit Branch:", TiDBGitBranch)
fmt.Println("Release Version: ", mysql.TiDBReleaseVersion)
fmt.Println("Git Commit Hash: ", TiDBGitHash)
fmt.Println("Git Commit Branch: ", TiDBGitBranch)
fmt.Println("UTC Build Time: ", TiDBBuildTS)
fmt.Println("GoVersion: ", GoVersion)
fmt.Println("TiKV Min Version: ", TiKVMinVersion)
}

// GetTiDBInfo returns the git hash and build time of this tidb-server binary.
func GetTiDBInfo() string {
return fmt.Sprintf("Release Version: %s\nGit Commit Hash: %s\nGit Branch: %s\nUTC Build Time: %s\nGoVersion: %s", mysql.TiDBReleaseVersion, TiDBGitHash, TiDBGitBranch, TiDBBuildTS, GoVersion)
return fmt.Sprintf("Release Version: %s\nGit Commit Hash: %s\nGit Branch: %s\nUTC Build Time: %s\nGoVersion: %s\nTiKV Min Version: %s",
mysql.TiDBReleaseVersion, TiDBGitHash, TiDBGitBranch, TiDBBuildTS, GoVersion, TiKVMinVersion)
}

// checkValidity checks whether cols and every data have the same length.
Expand Down

0 comments on commit bf5cae2

Please sign in to comment.