-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: refactor tree.RoutineExpr #95885
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @mgartner)
pkg/sql/sem/tree/routine.go
line 32 at r1 (raw file):
// by a RoutinePlanGenerator. isFinalPlan is true if no more plans will be // generated. type RoutinePlanEnumerator func(plan RoutinePlan, isFinalPlan bool) error
[super nit] I'm not sure RoutinePlanEnumerator
makes sense to me here, since it isn't doing the enumerating. Maybe something like RoutinePlanExecutor
?
3bf17bb
to
44b3a54
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 2 of 0 LGTMs obtained (waiting on @DrewKimball)
pkg/sql/sem/tree/routine.go
line 32 at r1 (raw file):
Previously, DrewKimball (Drew Kimball) wrote…
[super nit] I'm not sure
RoutinePlanEnumerator
makes sense to me here, since it isn't doing the enumerating. Maybe something likeRoutinePlanExecutor
?
Good point. How about RoutinePlanGeneratedFunc
? I'm steering away from Executor
because it assumes that they plan will be executed - but it doesn't have to be - the caller using the generator can do what they will with the plans.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @mgartner)
pkg/sql/sem/tree/routine.go
line 32 at r1 (raw file):
Previously, mgartner (Marcus Gartner) wrote…
Good point. How about
RoutinePlanGeneratedFunc
? I'm steering away fromExecutor
because it assumes that they plan will be executed - but it doesn't have to be - the caller using the generator can do what they will with the plans.
I like that better. Another option could be Handler
, but I'm ok with either of those.
982cb7e
to
69825d9
Compare
`tree.RoutineExpr` no longer tracks the number of statements in the routine. Instead, it has a `tree.RoutinePlanGenerator` that generates a plan for each statement in the routine, given a list of arguments, and invokes a given callback on the plan. Release note: None
69825d9
to
08ac8fd
Compare
TFTR! bors r+ |
Build succeeded: |
tree.RoutineExpr
no longer tracks the number of statements in theroutine. Instead, it has a
tree.RoutinePlanGenerator
that generates aplan for each statement in the routine, given a list of arguments, and
invokes a given callback on the plan.
Epic: None
Release note: None