Example #1
0
func (b *executorBuilder) buildSort(v *plan.Sort) Executor {
	src := b.build(v.GetChildByIndex(0))
	e := &SortExec{
		Src:     src,
		ByItems: v.ByItems,
		ctx:     b.ctx,
		Limit:   v.ExecLimit,
	}
	return e
}
Example #2
0
func (b *executorBuilder) buildSort(v *plan.Sort) Executor {
	src := b.build(v.GetChildByIndex(0))
	if v.ExecLimit != nil {
		return &TopnExec{
			SortExec: SortExec{
				Src:     src,
				ByItems: v.ByItems,
				ctx:     b.ctx,
				schema:  v.GetSchema()},
			limit: v.ExecLimit,
		}
	}
	return &SortExec{
		Src:     src,
		ByItems: v.ByItems,
		ctx:     b.ctx,
		schema:  v.GetSchema(),
	}
}