Skip to content

Commit

Permalink
check if table name should be included in translate ident
Browse files Browse the repository at this point in the history
  • Loading branch information
MarinPostma committed Oct 29, 2022
1 parent 784a7b8 commit 22e07aa
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions prql-compiler/src/sql/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,17 @@ pub(super) fn translate_ident(
context: &Context,
) -> Vec<sql_ast::Ident> {
let mut parts = Vec::with_capacity(4);
if let Some(relation) = relation_name {
// Special-case this for BigQuery, Ref #852
if matches!(context.dialect.dialect(), Dialect::BigQuery) {
parts.push(relation);
} else {
parts.extend(relation.split('.').map(|s| s.to_string()));
if !context.omit_ident_prefix || column.is_none() {
if let Some(relation) = relation_name {
// Special-case this for BigQuery, Ref #852
if matches!(context.dialect.dialect(), Dialect::BigQuery) {
parts.push(relation);
} else {
parts.extend(relation.split('.').map(|s| s.to_string()));
}
}
}

parts.extend(column);

parts
Expand Down

0 comments on commit 22e07aa

Please sign in to comment.