Skip to content

Commit

Permalink
remove pub get method for table scan
Browse files Browse the repository at this point in the history
  • Loading branch information
goldmedal committed Aug 29, 2024
1 parent fb6f1a9 commit 608dcc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
20 changes: 0 additions & 20 deletions datafusion/expr/src/logical_plan/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2401,26 +2401,6 @@ impl TableScan {
fetch,
})
}

/// Get the table name
pub fn table_name(&self) -> TableReference {
self.table_name.clone()
}

/// Get the table source reference
pub fn source(&self) -> Arc<dyn TableSource> {
Arc::clone(&self.source)
}

/// Get the projection
pub fn projection(&self) -> Option<&[usize]> {
self.projection.as_deref()
}

/// Get the filters
pub fn filters(&self) -> &[Expr] {
&self.filters
}
}

/// Apply Cross Join to two logical plans
Expand Down
11 changes: 6 additions & 5 deletions datafusion/sql/src/unparser/plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use datafusion_expr::{
LogicalPlanBuilder, Projection, SortExpr,
};
use sqlparser::ast::{self, Ident, SetExpr};
use std::sync::Arc;

use super::{
ast::{
Expand Down Expand Up @@ -530,18 +531,18 @@ impl Unparser<'_> {
match plan {
LogicalPlan::TableScan(table_scan) => {
// TODO: support filters for table scan with alias
if alias.is_some() && !table_scan.filters().is_empty() {
if alias.is_some() && !table_scan.filters.is_empty() {
return not_impl_err!(
"Subquery alias is not supported for table scan with pushdown filters"
);
}

let mut builder = LogicalPlanBuilder::scan(
table_scan.table_name(),
table_scan.source(),
table_scan.table_name.clone(),
Arc::clone(&table_scan.source),
None,
)?;
if let Some(project_vec) = table_scan.projection() {
if let Some(project_vec) = &table_scan.projection {
let project_columns = project_vec
.iter()
.cloned()
Expand All @@ -562,7 +563,7 @@ impl Unparser<'_> {
}

let filter_expr = table_scan
.filters()
.filters
.iter()
.cloned()
.reduce(|acc, expr| acc.and(expr));
Expand Down

0 comments on commit 608dcc2

Please sign in to comment.