-
Notifications
You must be signed in to change notification settings - Fork 592
Closed
Labels
Milestone
Description
Describe the bug
When a query, which contains a question mark ? and a Metabase filter is executed agaisnt a Clickhouse database, the ? is replaced by null and the query execution fails.
A similar query on Postgres JDBC doesn't fail
To Reproduce
- Prepare the following query in Metabase (using new SQL Query) and select a Clickhouse database
WITH
data as (SELECT '1' as `field?`)
SELECT *
FROM data
WHERE `field?` = {{data_filter}}
- Set the data_filter to type string and value 1
- Execute the query
- Query fails with the following error
Code: 47. DB::Exception: Unknown expression or function identifier `fieldnull` in scope WITH data AS (SELECT '1' AS `field'1'`) SELECT * FROM data WHERE fieldnull = NULL. (UNKNOWN_IDENTIFIER) (version 24.9.3.128 (official build))
When either the ? or WHERE clause is removed, the query is executed successfully.
This behavior cannot be reproduced with a similar query against a PostgreSQL database.
Expected behavior
The Query returns '1'
Configuration
Environment
- Client version: metabase-clickhouse-driver 1.53.3, used JDBC-v2
0.8.2
- Language version:
- OS:
related to metabase/metabase#56364
KrasnovidKE