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

Method sortKeysOfSource

compiler/optimizer/optimizer.go:398–423  ·  view source on GitHub ↗
(op dag.Op)

Source from the content-addressed store, hash-verified

396}
397
398func (o *Optimizer) sortKeysOfSource(op dag.Op) (order.SortKeys, error) {
399 switch op := op.(type) {
400 case *dag.DefaultScan:
401 return op.SortKeys, nil
402 case *dag.FileScan:
403 return nil, nil
404 case *dag.HTTPScan:
405 return nil, nil
406 case *dag.PoolScan:
407 return o.sortKey(op.ID)
408 case *dag.ListerScan:
409 return o.sortKey(op.Pool)
410 case *dag.SeqScan:
411 return o.sortKey(op.Pool)
412 case *dag.CommitMetaScan:
413 if op.Tap && op.Meta == "objects" {
414 // For a tap into the object stream, we compile the downstream
415 // DAG as if it were a normal query (so the optimizer can prune
416 // objects etc.) but we execute it in the end as a meta-query.
417 return o.sortKey(op.Pool)
418 }
419 return nil, nil //XXX is this right?
420 default:
421 return nil, fmt.Errorf("internal error: unknown source type %T", op)
422 }
423}
424
425func (o *Optimizer) sortKey(id ksuid.KSUID) (order.SortKeys, error) {
426 pool, err := o.lookupPool(id)

Callers 4

OptimizeDeleterMethod · 0.95
optimizeSourcePathsMethod · 0.95
propagateSortKeyOpMethod · 0.95
parallelizeSeqScanMethod · 0.95

Calls 1

sortKeyMethod · 0.95

Tested by

no test coverage detected