(op dag.Op)
| 396 | } |
| 397 | |
| 398 | func (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 | |
| 425 | func (o *Optimizer) sortKey(id ksuid.KSUID) (order.SortKeys, error) { |
| 426 | pool, err := o.lookupPool(id) |
no test coverage detected