Skip to content

give plan nodes bounds #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2018
Merged

give plan nodes bounds #142

merged 1 commit into from
Oct 18, 2018

Conversation

jpacik
Copy link
Contributor

@jpacik jpacik commented Oct 17, 2018

This PR gives a PlanNode time bounds. Originally I had tried to make bounds plan node statistics. However, because the execution engine uses the bounds associated with each plan node, the execution engine would also have to have access to input statistics for each node. To go that direction would require more design, so instead I made bounds a property of the node itself. Thoughts?

@jpacik jpacik self-assigned this Oct 17, 2018
@jpacik jpacik requested a review from wolffcm October 17, 2018 18:56
Copy link

@wolffcm wolffcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the bounds computing should happen at the end of planning, rather than the beginning. Maybe I'm missing something but that seems to make more sense to me.

}
}

s, bdd := node.ProcedureSpec().(BoundedProcedureSpec)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what the behavior for the flux function shift should be here. It's not bounded in the same way that range is, it just translates the time columns in its input by a fixed amount.

Maybe instead of BoundedProcedureSpec as an interface we need something like this

type BoundsAwareProcedureSpec interface {
    TimeBounds(predBounds *plan.Bounds) plan.Bounds
}

Both range and shift could implement this, but range would intersect, and shift would shift.

The behavior you have here is also the behavior of the old planner, so if you don't want to do this now, maybe that's okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely overlooked shift. You are right, procedures should implement their own TimeBounds method. This is an easy fix. I'll add it.

@@ -134,6 +146,10 @@ func createLogicalPlan(spec *flux.Spec, a Administration) (*PlanSpec, error) {
return nil, err
}

if err := v.plan.BottomUpWalk(ComputeBounds); err != nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expected this to be in the physical planner, computed just before returning the final plan. The reason is, there may be rules we apply that refine the time bounds on the plan nodes, for example, if we can push a range down through a window.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right, I'll move this to end of planning.

@wolffcm
Copy link

wolffcm commented Oct 18, 2018

Looks great. I like the tests.

@jpacik jpacik force-pushed the jl-planner-bounds branch from 91cc5a4 to 3c6d310 Compare October 18, 2018 17:09
@jpacik jpacik merged commit e4c877f into feat-planner Oct 18, 2018
@jpacik jpacik deleted the jl-planner-bounds branch October 18, 2018 17:11
jpacik pushed a commit that referenced this pull request Oct 26, 2018
jpacik pushed a commit that referenced this pull request Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants