-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve PhysicalExpr and Column documentation #12457
Conversation
@@ -31,8 +31,27 @@ use datafusion_expr_common::columnar_value::ColumnarValue; | |||
use datafusion_expr_common::interval_arithmetic::Interval; | |||
use datafusion_expr_common::sort_properties::ExprProperties; | |||
|
|||
/// See [create_physical_expr](https://docs.rs/datafusion/latest/datafusion/physical_expr/fn.create_physical_expr.html) | |||
/// for examples of creating `PhysicalExpr` from `Expr` | |||
/// [`PhysicalExpr`]s represent expressions such as `A + 1` or `CAST(c1 AS int)`. |
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.
it was strange there was no explanation of what a PhysicalExpr
was on the trait, so let's fix that (moved the docs from create_physical_expr
and revamped it a bit)
@@ -33,32 +33,67 @@ use datafusion_expr::ColumnarValue; | |||
use crate::physical_expr::{down_cast_any_ref, PhysicalExpr}; | |||
|
|||
/// Represents the column at a given index in a RecordBatch | |||
/// | |||
/// This is a physical expression that represents a column at a given index in a |
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.
The point that physical exprs are always in terms of indexes wasn't as clear as I think it could be so I tried to improve that
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.
Thank you for the doc improvement @alamb! I did found myself digging into doc to find how to create PhysicalExpr
from Expr
. This improvement will make such kind of process faster. Thank you!
Co-authored-by: Chunchun Ye <[email protected]>
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.
thanks, that really helps!
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.
👍
Thanks for the reviews and merge @jayzhan211 and @comphead |
Which issue does this PR close?
Part of #4028
Rationale for this change
While working with @itsjunetime on #12135
I noticed that the description / documentation of
PhysicalExpr
was not as clear as it could be:Column
epr was also not as well documented as it could beWhat changes are included in this PR?
Improve the documentation so this is clearer
Are these changes tested?
By docs CI
Are there any user-facing changes?
No functional changes, only documentation