Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
elsa0520 committed Dec 1, 2022
1 parent bd8bfbf commit 1278671
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions planner/core/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,8 +633,8 @@ func rewriteTableScanAndAggArgs(physicalTableScan *PhysicalTableScan, aggFuncs [
// table scan (row_id) -> (not null column)
physicalTableScan.Columns[0] = resultColumnInfo
physicalTableScan.schema.Columns[0] = resultColumn
// agg args count(1) -> count(not null column)
args := resultColumn.Clone()
// agg arg count(1) -> count(not null column)
arg := resultColumn.Clone()
for _, aggFunc := range aggFuncs {
constExpr, ok := aggFunc.Args[0].(*expression.Constant)
if !ok {
Expand All @@ -644,7 +644,7 @@ func rewriteTableScanAndAggArgs(physicalTableScan *PhysicalTableScan, aggFuncs [
if constExpr.Value.IsNull() {
continue
}
aggFunc.Args[0] = args
aggFunc.Args[0] = arg
}
}

Expand Down

0 comments on commit 1278671

Please sign in to comment.