Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
george24601 committed May 13, 2024
1 parent df36267 commit e231eb0
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion _posts/2024/2024-05-13-tidb-join.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
layout: post
title: "How does TiDB translate JOIN into logical plans"
title: "How does TiDB translate JOIN and GROUP BY into logical plans"
description: ""
category:
tags: [tidb, golang]
Expand Down Expand Up @@ -61,3 +61,34 @@ func (b *planBuilder) buildJoin(join *ast.Join) LogicalPlan {
```


```go
// AggFuncDesc describes an aggregation function signature, only used in planner.
type AggFuncDesc struct {
// Name represents the aggregation function name.
Name string
// Args represents the arguments of the aggregation function.
Args []expression.Expression
// RetTp represents the return type of the aggregation function.
RetTp *types.FieldType
// Mode represents the execution mode of the aggregation function.
Mode AggFunctionMode
// HasDistinct represents whether the aggregation function contains distinct attribute.
HasDistinct bool
}
// LogicalAggregation represents an aggregate plan.
type LogicalAggregation struct {
logicalSchemaProducer
AggFuncs []*aggregation.AggFuncDesc
GroupByItems []expression.Expression
// groupByCols stores the columns that are group-by items.
groupByCols []*expression.Column
possibleProperties [][]*expression.Column
inputCount float64 // inputCount is the input count of this plan.
}
```

0 comments on commit e231eb0

Please sign in to comment.