Skip to content

Commit

Permalink
Merge pull request #7218 from b41sh/chore-view-query-dialect
Browse files Browse the repository at this point in the history
chore(planner): view query use PostgreSQL dialect
  • Loading branch information
mergify[bot] authored Aug 21, 2022
2 parents 452a8aa + a301f38 commit 87ecd91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/query/service/src/sql/planner/binder/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use common_ast::ast::TimeTravelPoint;
use common_ast::parser::parse_sql;
use common_ast::parser::tokenize_sql;
use common_ast::Backtrace;
use common_ast::Dialect;
use common_ast::DisplayError;
use common_catalog::catalog::CATALOG_DEFAULT;
use common_datavalues::prelude::*;
Expand Down Expand Up @@ -135,11 +136,9 @@ impl<'a> Binder {
.options()
.get(QUERY)
.ok_or_else(|| ErrorCode::LogicalError("Invalid VIEW object"))?;
let settings = self.ctx.get_settings();
let sql_dialect = settings.get_sql_dialect()?;
let tokens = tokenize_sql(query.as_str())?;
let backtrace = Backtrace::new();
let (stmt, _) = parse_sql(&tokens, sql_dialect, &backtrace)?;
let (stmt, _) = parse_sql(&tokens, Dialect::PostgreSQL, &backtrace)?;
if let Statement::Query(query) = &stmt {
self.bind_query(bind_context, query).await
} else {
Expand Down

1 comment on commit 87ecd91

@vercel
Copy link

@vercel vercel bot commented on 87ecd91 Aug 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

databend – ./

databend-git-main-databend.vercel.app
databend-databend.vercel.app
databend.rs
databend.vercel.app

Please sign in to comment.