Skip to content

Commit

Permalink
Merge pull request pingcap#19 from rebelice/dev_limit
Browse files Browse the repository at this point in the history
support limit
  • Loading branch information
crazycs520 authored Jan 7, 2022
2 parents 81e897c + 7dcfa1d commit 7db01e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions planner/core/common_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,7 @@ type RestoreData struct {
Agg string
GroupBy string
Where []string
Limit string
}

func (d *RestoreData) String() string {
Expand Down Expand Up @@ -1650,6 +1651,10 @@ func (d *RestoreData) String() string {
fmt.Fprint(&buffer, " group by ")
fmt.Fprint(&buffer, d.GroupBy)
}
if len(d.Limit) != 0 {
fmt.Fprint(&buffer, " limit ")
fmt.Fprint(&buffer, d.Limit)
}
return buffer.String()
}

Expand Down Expand Up @@ -1748,6 +1753,11 @@ func BuildAWSQueryInfo(v *PhysicalTableReader, id int64) *RestoreData {
}
info.GroupBy = buffer.String()
}
case *PhysicalLimit:
if x.Offset != 0 {
logutil.BgLogger().Warn("S3 don't support OFFSET for LIMIT")
}
info.Limit = fmt.Sprintf("%v", x.Count)
}
}
return &info
Expand Down

0 comments on commit 7db01e9

Please sign in to comment.