Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"hash" column name is not escaped in Big Query #5166

Open
2 tasks done
mihkelambre opened this issue Feb 28, 2025 · 0 comments
Open
2 tasks done

"hash" column name is not escaped in Big Query #5166

mihkelambre opened this issue Feb 28, 2025 · 0 comments
Labels
bug Invalid compiler output or panic

Comments

@mihkelambre
Copy link

What happened?

Cannot select a column named 'hash' because BigQuery recognizes 'hash' as a function. PRQL does not escape the column name (by adding backticks) nor does it preserve existing backticks, as shown in the example below.

PRQL input

prql target:sql.bigquery

from `some_dataset_id.demo`
select {
  `hash`
}

SQL output

SELECT
  hash
FROM
  `some_dataset_id.demo`

-- Generated by PRQL compiler version:0.13.3 (https://prql-lang.org)

Expected SQL output

SELECT
  `hash`
FROM
  `some_dataset_id.demo`

MVCE confirmation

  • Minimal example
  • New issue

Anything else?

No response

@mihkelambre mihkelambre added the bug Invalid compiler output or panic label Feb 28, 2025
nsiregar added a commit to nsiregar/prql that referenced this issue Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Invalid compiler output or panic
Projects
None yet
Development

No branches or pull requests

1 participant