-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT] [New Query Plan] Add support for Projection and Coalesce, enab…
…le many tests (#1256) This PR adds support for projection (`df.select()`, `df.exclude()`, `df.with_column()`) and coalescing (`df.into_partitions()`), and enables a bunch of tests that depended on these features. The main fixes that popped up once enabling the tests were: - Misc. input validation - Missing plan flattening for `df.repartition()` with unknown partition scheme (i.e. simple split). This PR is stacked on #1254 and #1252, so the final commit contains the actual diff: 6754d67
- Loading branch information
1 parent
34443aa
commit 48b46b3
Showing
31 changed files
with
271 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::LogicalPlan; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Coalesce { | ||
// Number of partitions to coalesce to. | ||
pub num_to: usize, | ||
// Upstream node. | ||
pub input: Arc<LogicalPlan>, | ||
} | ||
|
||
impl Coalesce { | ||
pub(crate) fn new(num_to: usize, input: Arc<LogicalPlan>) -> Self { | ||
Self { num_to, 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
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,28 @@ | ||
use std::sync::Arc; | ||
|
||
use daft_core::schema::SchemaRef; | ||
use daft_dsl::Expr; | ||
|
||
use crate::LogicalPlan; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Project { | ||
pub projection: Vec<Expr>, | ||
pub projected_schema: SchemaRef, | ||
// Upstream node. | ||
pub input: Arc<LogicalPlan>, | ||
} | ||
|
||
impl Project { | ||
pub(crate) fn new( | ||
projection: Vec<Expr>, | ||
projected_schema: SchemaRef, | ||
input: Arc<LogicalPlan>, | ||
) -> Self { | ||
Self { | ||
projection, | ||
projected_schema, | ||
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::sync::Arc; | ||
|
||
use crate::physical_plan::PhysicalPlan; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Flatten { | ||
// Upstream node. | ||
pub input: Arc<PhysicalPlan>, | ||
} | ||
|
||
impl Flatten { | ||
pub(crate) fn new(input: Arc<PhysicalPlan>) -> Self { | ||
Self { 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
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,18 @@ | ||
use std::sync::Arc; | ||
|
||
use daft_dsl::Expr; | ||
|
||
use crate::physical_plan::PhysicalPlan; | ||
|
||
#[derive(Clone, Debug)] | ||
pub struct Project { | ||
pub projection: Vec<Expr>, | ||
// Upstream node. | ||
pub input: Arc<PhysicalPlan>, | ||
} | ||
|
||
impl Project { | ||
pub(crate) fn new(projection: Vec<Expr>, input: Arc<PhysicalPlan>) -> Self { | ||
Self { projection, 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
Oops, something went wrong.