This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
Backtick-quoted column name in SQL output from query with count_distinct
#26
Labels
bug
Something isn't working
Cool project!
I used the prql-query CLI-tool v0.0.14 in the following examples.
The problem
When compiling:
to sql I get:
I did not expect the output to have a column name quoted with backticks (and neither did the database I sent it to, roapi).
In contrast
If we have a weird column name and backtick-quote it in the select statement of the prql:
we get a column name with double-quotes as expected:
Possible culprit
Searching the codebase I found this line in prql-compiler/src/sql/std_impl.prql:
func count_distinct <scalar|column> column -> s"COUNT(DISTINCT `{column}`)"
which contains backticks. Is there a good reason for this? None of the other functions in the file use backticks.
The text was updated successfully, but these errors were encountered: