-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Bug
Queries using the new LAG/LEAD SQL pushdown (added in v1.6.14 via #10407) fail against ClickHouse with:
Error: Unknown data type family: STRING. Maybe you meant: ['String','Ring']
Root Cause
BaseQuery.js defines the default type template as:
types: {
string: 'STRING',
...
}ClickHouseQuery.ts overrides several types (boolean, timestamp, etc.) in sqlTemplates() but does not override string. ClickHouse type names are case-sensitive and require String, not STRING.
When LAG/LEAD pushdown generates the full SQL sent to ClickHouse, it includes internal columns:
CAST(NULL, 'STRING') AS __user, CAST(NULL, 'STRING') AS __cubejoinfield,ClickHouse rejects STRING as an unknown type.
Expected Behavior
The query should execute successfully against ClickHouse.
Suggested Fix
Add the string type override in ClickHouseQuery.ts sqlTemplates():
templates.types.string = 'String';Environment
- Cube version: v1.6.14
- Database: ClickHouse
- API: SQL API (PostgreSQL wire protocol)
Reproduction
Run any query using LAG() or LEAD() window functions via the Cube SQL API against a ClickHouse data source.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels