Skip to content

Conversation

@jayzhan211
Copy link
Contributor

Which issue does this PR close?

Closes #9921.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
@github-actions github-actions bot added the physical-expr Changes to the physical-expr crates label Apr 3, 2024
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
@jayzhan211 jayzhan211 marked this pull request as ready for review April 4, 2024 05:54
/// [`create_physical_expr`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/fn.create_physical_expr.html
///
/// # Example: Create `PhysicalExpr` from `Expr`
/// ```ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since datafusion_physical_expr::create_physical_expr should stay in physical-expr, so we can't run the doc test here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest we move the examples to create_physical_expr so it continues to run in tests and link to it via html. Something like

See [create_physical_expr] for examples of creating `PhysicalExpr` from `Expr`:

[create_physical_expr]: https://docs.rs/datafusion/latest/datafusion/physical_expr/fn.create_physical_expr.html

@jayzhan211 jayzhan211 requested review from alamb and mustafasrepo April 4, 2024 05:55
@alamb alamb changed the title Move PhysicalExpr and PhysicalSortExpr to physical-expr-core Move AggregateExpr, PhysicalExpr and PhysicalSortExpr to physical-expr-core Apr 4, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thanks @jayzhan211 -- this looks quite good to me. It is a very exciting step forward

I suggest renaming this crate to datafusion-physical-expr-common to follow the same pattern of datafusion-common but I don't think that is required

cc @mustafasrepo and @berkaysynnada

Comment on lines 24 to 25
This crate is a submodule of DataFusion that provides the core functionality of physical expressions.
Like `PhysicalExpr` or `PhysicalSortExpr` and related things.
Copy link
Contributor

Choose a reason for hiding this comment

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

Here is a very minor suggestion:

Suggested change
This crate is a submodule of DataFusion that provides the core functionality of physical expressions.
Like `PhysicalExpr` or `PhysicalSortExpr` and related things.
This crate is a submodule of DataFusion that provides shared APIs for implementing
physical expressions such as `PhysicalExpr` and `PhysicalSortExpr`.

/// [`create_physical_expr`]: https://docs.rs/datafusion/latest/datafusion/physical_expr/fn.create_physical_expr.html
///
/// # Example: Create `PhysicalExpr` from `Expr`
/// ```ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest we move the examples to create_physical_expr so it continues to run in tests and link to it via html. Something like

See [create_physical_expr] for examples of creating `PhysicalExpr` from `Expr`:

[create_physical_expr]: https://docs.rs/datafusion/latest/datafusion/physical_expr/fn.create_physical_expr.html

use arrow::datatypes::Field;
use datafusion_common::{not_impl_err, Result};
use datafusion_expr::{Accumulator, GroupsAccumulator};
pub use datafusion_physical_expr_core::aggregate::AggregateExpr;
Copy link
Contributor

Choose a reason for hiding this comment

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

💯 for backwards compatibility

pub use cast::{cast, cast_with_options, CastExpr};
pub use column::{col, Column, UnKnownColumn};
pub use column::UnKnownColumn;
pub use datafusion_physical_expr_core::expressions::column::{col, Column};
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Signed-off-by: jayzhan211 <[email protected]>
Signed-off-by: jayzhan211 <[email protected]>
Copy link
Contributor

@mustafasrepo mustafasrepo left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @jayzhan211 for this PR.

@alamb alamb merged commit 1dd5354 into apache:main Apr 5, 2024
@alamb
Copy link
Contributor

alamb commented Apr 5, 2024

Thanks @jayzhan211 and @mustafasrepo 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-expr Changes to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move PhysicalExpr and PhysicalSortExpr to physical-expr-core

3 participants