kszucs / pandahouse

Pandas interface for Clickhouse database
MIT License
228 stars 70 forks source link

Double quote converts into backquote #33

Open d1bevz opened 3 years ago

d1bevz commented 3 years ago

I'm using pandahouse to execute query with where-condition using string that contains apostrophe in its value (e.g. Rock'n'Roll) Normally I use double-quote in datagrip and all works just fine But it seems to me read_clickhouse function just converts all double quotes into backquotes and it forces clickhouse to see this expression as a column For example the sting that I'm passing to read_clickhouse function as follows:

select * from sometable
where genre == "Rock'n'Roll"

As a result of read_clickhouse function I got mistake that clickhouse doesn't see the column Rock'n'Roll, because it executes not the same string, but:

select * from sometable
where genre == `Rock'n'Roll`

Actually all queries that have double-quotes fall because of this mistake I can't even use replaceAll(genre, "'", ' ') clickhouse-function, because it cannot see column ' - that is strange

Why is this happening?