Skip to content

Commit

Permalink
split up planner (#3095)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Apr 9, 2022
1 parent 806b63f commit a49128c
Show file tree
Hide file tree
Showing 10 changed files with 533 additions and 571 deletions.
1 change: 0 additions & 1 deletion polars/polars-lazy/src/physical_plan/executors/groupby.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use super::*;
use crate::logical_plan::Context;
use crate::prelude::utils::as_aggregated;
use crate::utils::rename_aexpr_root_names;
use polars_core::utils::{accumulate_dataframes_vertical, split_df};
use polars_core::POOL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ impl Executor for GroupByDynamicExec {

#[cfg(feature = "dynamic_groupby")]
fn execute(&mut self, state: &ExecutionState) -> Result<DataFrame> {
use crate::prelude::{utils::as_aggregated, *};

let df = self.input.execute(state)?;
state.set_schema(self.input_schema.clone());
let keys = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ impl Executor for GroupByRollingExec {

#[cfg(feature = "dynamic_groupby")]
fn execute(&mut self, state: &ExecutionState) -> Result<DataFrame> {
use crate::prelude::{utils::as_aggregated, *};

let df = self.input.execute(state)?;
state.set_schema(self.input_schema.clone());

Expand Down
38 changes: 22 additions & 16 deletions polars/polars-lazy/src/physical_plan/executors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
pub(crate) mod cache;
pub(crate) mod drop_duplicates;
pub(crate) mod explode;
pub(crate) mod filter;
pub(crate) mod groupby;
pub(crate) mod groupby_dynamic;
pub(crate) mod groupby_rolling;
pub(crate) mod join;
pub(crate) mod melt;
pub(crate) mod projection;
pub(crate) mod scan;
pub(crate) mod slice;
pub(crate) mod sort;
pub(crate) mod stack;
pub(crate) mod udf;
pub(crate) mod union;
mod cache;
mod drop_duplicates;
mod explode;
mod filter;
mod groupby;
mod groupby_dynamic;
mod groupby_rolling;
mod join;
mod melt;
mod projection;
mod scan;
mod slice;
mod sort;
mod stack;
mod udf;
mod union;

pub(super) use self::{
cache::*, drop_duplicates::*, explode::*, filter::*, groupby::*, groupby_dynamic::*,
groupby_rolling::*, join::*, melt::*, projection::*, scan::*, slice::*, sort::*, stack::*,
udf::*, union::*,
};

use super::*;
use crate::logical_plan::FETCH_ROWS;
Expand Down
47 changes: 26 additions & 21 deletions polars/polars-lazy/src/physical_plan/expressions/mod.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
pub(crate) mod aggregation;
pub(crate) mod alias;
pub(crate) mod apply;
pub(crate) mod binary;
pub(crate) mod cast;
pub(crate) mod column;
pub(crate) mod count;
pub(crate) mod filter;
pub(crate) mod is_not_null;
pub(crate) mod is_null;
pub(crate) mod literal;
pub(crate) mod not;
pub(crate) mod shift;
pub(crate) mod slice;
pub(crate) mod sort;
pub(crate) mod sortby;
pub(crate) mod take;
pub(crate) mod ternary;
pub(crate) mod utils;
pub(crate) mod window;
// pub(crate) mod unique;
mod aggregation;
mod alias;
mod apply;
mod binary;
mod cast;
mod column;
mod count;
mod filter;
mod is_not_null;
mod is_null;
mod literal;
mod not;
mod shift;
mod slice;
mod sort;
mod sortby;
mod take;
mod ternary;
mod utils;
mod window;

pub(crate) use {
aggregation::*, alias::*, apply::*, binary::*, cast::*, column::*, count::*, filter::*,
is_not_null::*, is_null::*, literal::*, not::*, shift::*, slice::*, sort::*, sortby::*,
take::*, ternary::*, utils::*, window::*,
};

use crate::physical_plan::state::ExecutionState;
use crate::prelude::*;
Expand Down
1 change: 0 additions & 1 deletion polars/polars-lazy/src/physical_plan/expressions/sortby.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::physical_plan::state::ExecutionState;
use crate::prelude::sort::{map_sorted_indices_to_group_idx, map_sorted_indices_to_group_slice};
use crate::prelude::*;
use polars_core::frame::groupby::{GroupsIndicator, GroupsProxy};
use polars_core::prelude::*;
Expand Down

0 comments on commit a49128c

Please sign in to comment.