MCPcopy Create free account
hub / github.com/brimdata/super / propagateSortKey

Method propagateSortKey

compiler/optimizer/optimizer.go:302–314  ·  view source on GitHub ↗

propagateSortKey analyzes a Seq and attempts to push the scan order of the data source into the first downstream aggregation. (We could continue the analysis past that point but don't bother yet because we do not yet support any optimization past the first aggregation.) For parallel paths, we prop

(seq dag.Seq, parents []order.SortKeys)

Source from the content-addressed store, hash-verified

300// past the first aggregation.) For parallel paths, we propagate
301// the scan order if its the same at egress of all of the paths.
302func (o *Optimizer) propagateSortKey(seq dag.Seq, parents []order.SortKeys) ([]order.SortKeys, error) {
303 if len(seq) == 0 {
304 return parents, nil
305 }
306 for _, op := range seq {
307 var err error
308 parents, err = o.propagateSortKeyOp(op, parents)
309 if err != nil {
310 return []order.SortKeys{nil}, err
311 }
312 }
313 return parents, nil
314}
315
316func (o *Optimizer) propagateSortKeyOp(op dag.Op, parents []order.SortKeys) ([]order.SortKeys, error) {
317 switch op.(type) {

Callers 3

optimizeSourcePathsMethod · 0.95
SortKeysMethod · 0.95
propagateSortKeyOpMethod · 0.95

Calls 1

propagateSortKeyOpMethod · 0.95

Tested by

no test coverage detected