Open ilya-zlobintsev opened 1 year ago
If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.
Same issue here, but I guess it happens for all the drivers if we have ?
symbol in the sql statement when we do filter
Example: it will replace ?
symbol to the filter
sql:`
SELECT 'https://abc.com?id=123' link
`,
Describe the bug Some Clickhouse functions such as sequenceMatch use question marks in their syntax. Cube.js will always treat the question marks as parameters, and there doesn't seem to be a way to escape them.
To Reproduce Steps to reproduce the behavior:
sequenceMatch
function with?
in the syntaxExpected behavior With the example Cube schema, I would expect the following SQL to be generated:
Actual behaviour Instead, the generated SQL is this:
Minimally reproducible Cube Schema
Query JSON:
Version: 0.31.32
Additional context This happens because the Cube Clickhouse driver uses the sqlstring library for escaping SQL queries, which is designed for MySQL and not Clickhouse. The library does not support escaping the question mark.