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

Function Optimize

compiler/package.go:28–45  ·  view source on GitHub ↗
(ctx context.Context, main *dag.Main, env *exec.Environment, parallel int)

Source from the content-addressed store, hash-verified

26}
27
28func Optimize(ctx context.Context, main *dag.Main, env *exec.Environment, parallel int) error {
29 // Call optimize to possible push down a filter predicate into the
30 // rungen.Reader so that the BSUP scanner can do Boyer-Moore.
31 o := optimizer.New(ctx, env)
32 if err := o.Optimize(main); err != nil {
33 return err
34 }
35 if parallel > 1 {
36 // For an internal reader (like a shaper on intake), we don't do
37 // any parallelization right now though this could be potentially
38 // beneficial depending on where the bottleneck is for a given shaper.
39 // See issue #2641.
40 if err := o.Parallelize(main, parallel); err != nil {
41 return err
42 }
43 }
44 return nil
45}
46
47func Build(rctx *runtime.Context, main *dag.Main, env *exec.Environment, readers []sio.Reader) (map[string]vio.Puller, *op.DebugChans, vio.Meter, error) {
48 b := rungen.NewBuilder(rctx, env)

Callers 4

RunMethod · 0.92
runCasesHelperFunction · 0.92
CompileWithASTFunction · 0.85
CompileWithSortKeyFunction · 0.85

Calls 3

NewFunction · 0.92
OptimizeMethod · 0.80
ParallelizeMethod · 0.80

Tested by 1

runCasesHelperFunction · 0.74