Replacing Option<Vec<_>> with Vec<_>? in ExecutionPlan #7905
mustafasrepo
started this conversation in
General
Replies: 1 comment 2 replies
-
If we are going to change So the API perhaps could look something like enum OutputOrdering {
Unknown,
Known(Vec<PhysicalSortExpr]>),
}
...
trait ExecutionPlan {
fn output_ordering(&self) -> &OutputOrdering ;
...
} The rationale to make an enum is twofold:
I think making a structure would be even more helpful for required_input_ordering whose signature is actually |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the codebase
fn output_ordering(&self)
API ofExecutionPlan
returnsOption<&[PhysicalSortExpr]>
.Similarly, fn
required_input_ordering(&self)
API returnsOption<Vec<PhysicalSortRequirement>>
for each children.I think, we can replace these APIs with the version without
Option
(e.g&[PhysicalSortExpr]
,Vec<PhysicalSortRequirement>
respectively). I think this would simplify code a bit ,improve readability. The information represented withNone
is same with empty vector.I wonder what community thinks about this? Should we do this change, or is existing API better? (If so, how?)
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions