-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE] LogicalPlan: Add display improvements, and Filter (#1221)
- Add `LogicalPlan::Filter` and integrate it all the way to the Python DataFrame API. - Implement Display (single-node display) and TreeDisplay (entire plan display) for LogicalPlan. ``` >>> import daft >>> df = daft.read_parquet("out.pq") 2023-08-02 17:47:32.456 | INFO | daft.context:runner:86 - Using PyRunner >>> df = df.where(daft.col("a") > 0) >>> df._plan * Filter: col(a) > lit(0) | * Source: Parquet | /Users/charles/daft/out.pq/da78add6-a17a-47e6-bd39-2de437a64969-0.parquet | File schema: a (Int64) | Output schema: a (Int64) ``` --------- Co-authored-by: Xiayue Charles Lin <[email protected]>
- Loading branch information
1 parent
bc65aaf
commit 839d18c
Showing
10 changed files
with
168 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::sync::Arc; | ||
|
||
use daft_dsl::ExprRef; | ||
|
||
use crate::LogicalPlan; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Filter { | ||
// The Boolean expression to filter on. | ||
pub predicate: ExprRef, | ||
// Upstream node. | ||
pub input: Arc<LogicalPlan>, | ||
} | ||
|
||
impl Filter { | ||
pub(crate) fn new(predicate: ExprRef, input: Arc<LogicalPlan>) -> Self { | ||
Self { predicate, input } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod filter; | ||
mod source; | ||
|
||
pub use filter::Filter; | ||
pub use source::Source; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters