Skip to content

Commit

Permalink
commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jan 26, 2025
1 parent bdaabd6 commit ed913d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use crate::utils::aexpr_to_leaf_names;
#[derive(Default, Copy, Clone)]
struct ProjectionCopyState {
projections_seen: usize,
count_star: bool,
is_count_star: bool,
}

#[derive(Clone, Default)]
Expand Down Expand Up @@ -58,7 +58,7 @@ impl ProjectionContext {
fn has_pushed_down(&self) -> bool {
// count star also acts like a pushdown as we will select a single column at the source
// when there were no other projections.
!self.acc_projections.is_empty() || self.inner.count_star
!self.acc_projections.is_empty() || self.inner.is_count_star
}

fn process_count_star_at_scan(&mut self, schema: &Schema, expr_arena: &mut Arena<AExpr>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,65 +22,10 @@ pub(super) fn process_projection(
// as there would be no projections and we would read
// the whole file while we only want the count
if exprs.len() == 1 && is_count(exprs[0].node(), expr_arena) {
//let input_schema = lp_arena.get(input).schema(lp_arena);
//let expr = exprs[0].node();
//let expr = if input_schema.is_empty() {
// // If the input schema is empty, we should just project
// // ourselves
// exprs[0].node()
//} else {
// // Select the last column projection.
// let (last_name, _) = input_schema.try_get_at_index(input_schema.len() - 1)?;
//
// let name = match lp_arena.get(input) {
// IR::Select { expr: exprs, .. } | IR::HStack { exprs, .. } => (|| {
// for e in exprs {
// if !e.is_scalar(expr_arena) {
// return e.output_name();
// }
// }
//
// last_name
// })(),
//
// IR::Scan {
// file_info,
// output_schema,
// ..
// } => {
// let schema = output_schema.as_ref().unwrap_or(&file_info.schema);
// // NOTE: the first can be the inserted index column, so that might not work
// let (last_name, _) = schema.try_get_at_index(schema.len() - 1)?;
// last_name
// },
//
// IR::DataFrameScan {
// schema,
// output_schema,
// ..
// } => {
// // NOTE: the first can be the inserted index column, so that might not work
// let schema = output_schema.as_ref().unwrap_or(schema);
// let (last_name, _) = schema.try_get_at_index(schema.len() - 1)?;
// last_name
// },
//
// _ => last_name,
// };
//
// expr_arena.add(AExpr::Column(name.clone()))
//};

// Clear all accumulated projections since we only project a single column from this level.
ctx.acc_projections.clear();
ctx.projected_names.clear();
ctx.inner.count_star = true;
//add_expr_to_accumulated(
// expr,
// &mut ctx.acc_projections,
// &mut ctx.projected_names,
// expr_arena,
//);
ctx.inner.is_count_star = true;
local_projection.push(exprs.pop().unwrap());
proj_pd.is_count_star = true;
} else {
Expand Down

0 comments on commit ed913d3

Please sign in to comment.