Skip to content

Quoted Identifiers in BigQuery dialect. #3168

Closed Answered by georgesittas
rorynormaness asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @rorynormaness,

It seems like you may have missed setting the output dialect, because this is working as expected:

>>> from sqlglot import parse_one
>>> from sqlglot.optimizer.qualify import qualify
>>>
>>> ddl = "create table foo as select 1 as c"
>>>
>>> ast = parse_one(ddl,dialect="bigquery")
>>> qast = qualify(ast,dialect="bigquery", quote_identifiers=True, identify=True)
>>>
>>> print(qast.sql(dialect="bigquery"))
CREATE TABLE `foo` AS SELECT 1 AS `c`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rorynormaness
Comment options

Answer selected by georgesittas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants