-
Notifications
You must be signed in to change notification settings - Fork 130
Expression VTable #5191
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
Expression VTable #5191
Conversation
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
CodSpeed Performance ReportMerging #5191 will degrade performances by 14.62%Comparing Summary
Benchmarks breakdown
Footnotes
|
|
|
||
| /// Hash and PartialEq are implemented based on the ptr of the value function, such that the | ||
| /// internal value doesn't impact the hash of an expression tree. | ||
| struct Rhs { |
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.
can we choose a better name?
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.
This was here before, agree it's a bit weird but don't really want to change more than I need
| pub fn data(&self) -> &Arc<dyn Any + Send + Sync> { | ||
| &self.data | ||
| } |
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.
Is this what we have need calling metadata?
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.
Kind of...? Metadata sort of implied that it only held onto things that needed to be serialized. Instance data (as in, fat pointer of vtable + data), feels like it's more generic / familiar to the vtable structure.
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.
what do you expect to be in data?
vortex-expr/src/expression.rs
Outdated
| /// such as `x < (y < z)` or `x LIKE "needle%"`. | ||
| pub fn stat_falsification(&self, catalog: &mut dyn StatsCatalog) -> Option<Expression> { | ||
| self.vtable.as_dyn().stat_falsification(self, catalog) | ||
| } | ||
|
|
||
| /// An expression for the upper non-null bound of this expression, if available. | ||
| /// | ||
| /// This function returns None if there is no upper bound or it is difficult to compute. | ||
| /// | ||
| /// The returned expression evaluates to null if the maximum value is unknown. In that case, you | ||
| /// _must not_ assume the array is empty _nor_ may you assume the array only contains non-null | ||
| /// values. | ||
| pub fn max(&self, catalog: &mut dyn StatsCatalog) -> Option<Expression> { | ||
| self.vtable.as_dyn().max(self, catalog) | ||
| } | ||
|
|
||
| /// An expression for the lower non-null bound of this expression, if available. | ||
| /// | ||
| /// See [AnalysisExpr::max] for important details. | ||
| pub fn min(&self, catalog: &mut dyn StatsCatalog) -> Option<Expression> { |
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.
why add this to the expr, its will be a huge trait if we keep adding
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.
Anything that needs to be recursively called within a vtable implementation needs to be exposed on the public Expression API.
Agree these names are a bit weird / non-descriptive. Pulling them into a separate trait I don't think fixes that. Maybe stat_max() / stat_min() ?
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.
its more about having a trait for analysis stuff that is not on the expr itself
Experiment with new style of vtable.
Overview: