Skip to content

Commit

Permalink
Remove custom sqlparser expr visitor in favour of the native one
Browse files Browse the repository at this point in the history
  • Loading branch information
gruuya committed Nov 20, 2023
1 parent 084ddc7 commit fe7301f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 1,006 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ datafusion-expr = "32.0.0"
datafusion-remote-tables = { path = "./datafusion_remote_tables", optional = true }

deltalake = { git = "https://github.com/delta-io/delta-rs", rev = "2b913b37e71ed96212dcec8c3fc8e865754ced82", features = ["s3-native-tls", "datafusion-ext"] }
dynamodb_lock = { version = "0.6.1", default_features = false, features = ["native-tls"] }

futures = "0.3"
hex = ">=0.4.0"
Expand Down
5 changes: 2 additions & 3 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use object_store::path::Path;

use sqlparser::ast::{
AlterTableOperation, CreateFunctionBody, Expr as SqlExpr, FunctionDefinition,
ObjectType, Query, Statement, TableFactor, TableWithJoins,
ObjectType, Query, Statement, TableFactor, TableWithJoins, VisitMut,
};

use arrow_schema::{DataType, TimeUnit};
Expand Down Expand Up @@ -93,7 +93,6 @@ use crate::catalog::{DEFAULT_SCHEMA, STAGING_SCHEMA};
use crate::config::context::{build_object_store, build_state_with_table_factories};
use crate::config::schema;
use crate::config::schema::{GCS, S3};
use crate::datafusion::visit::VisitorMut;
use crate::delta_rs::backports::parquet_scan_from_actions;
#[cfg(test)]
use crate::frontend::http::tests::deterministic_uuid;
Expand Down Expand Up @@ -519,7 +518,7 @@ impl DefaultSeafowlContext {
async fn rewrite_time_travel_query(&self, q: &mut Query) -> Result<SessionState> {
let mut version_processor =
TableVersionProcessor::new(self.database.clone(), DEFAULT_SCHEMA.to_string());
version_processor.visit_query(q);
q.visit(&mut version_processor);

if version_processor.table_versions.is_empty() {
// No time-travel syntax detected, just return the regular session state
Expand Down
1 change: 0 additions & 1 deletion src/datafusion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@

pub mod parser;
pub mod utils;
pub mod visit;
Loading

0 comments on commit fe7301f

Please sign in to comment.