-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
driver:clickhouseIssues related to the ClickHouse driverIssues related to the ClickHouse driverhelp wantedCommunity contributions are welcome.Community contributions are welcome.
Description
Describe the bug
Cube generates incorrect query when measure of type 'string' is used as a filter with operator 'equals'. This applies to Clickhouse driver. Despite the measure being of type 'string', the generated HAVING clause tries to compare string value to the value of toFloat64(?).
To Reproduce
Steps to reproduce the behavior:
- Use Clickhouse driver
- Use the Cube schema that I provided below
- Run the query with a filter on 'string' measure and operator 'equals' (see attached screenshots)
Expected behavior
The correct query should be generated. Cube should not use the toFloat64 function.
Minimally reproducible Cube Schema
cube(`cubeA`, {
sql: `
select 1 as id, 100 as number
`,
dimensions: {
id: {
type: 'number',
sql: 'id',
primary_key: true
},
number: {
type: 'number',
sql: 'number'
}
},
measures: {
high_or_low: {
type: `string`,
sql: `CASE WHEN ${CUBE.number} > 100 THEN 'high' ELSE 'low' END`
},
},
});Version:
0.34.10
Metadata
Metadata
Assignees
Labels
driver:clickhouseIssues related to the ClickHouse driverIssues related to the ClickHouse driverhelp wantedCommunity contributions are welcome.Community contributions are welcome.

