ClickHouse enforces timestamptz
- Dominant language
- Rust
- Stars
- 20.8k
- Forks
- 2.1k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 181
Description
**Describe the bug**
Working with `Date` types from ClickHouse doesn't work, and `timestamptz` is always enforced even though it's not supported.
**To Reproduce**
Create a ClickHouse table with a `Date` column:
```sql
CREATE TABLE series (
date Date,
);
```
Create Cube.js model, as pasted below.
Then, query the date column, for example:
```json
{
"dimensions": [
"series.date"
]
}
```
You will see an error:
```
Query failed: Error: Unknown data type family: timestamptz. Maybe you meant: ['TIMESTAMP']:
```
Indeed, the generated SQL is as follow:
```sql
SELECT
timezone('UTC', "series".date :: timestamptz) "series__date"
FROM
series AS "series"
GROUP BY
1
ORDER BY
1 ASC
LIMIT
10000
```
**Expected behavior**
A clear and concise description of what you expected to happen.
**Minimally reproducible Cube Schema**
```javascript
cube("Series", {
data_source: "clickhouse",
sql: `
SELECT * FROM series
`,
dimensions: {
date: {
type: "time",
sql: "date",
},
},
});
```
**Version:**
1.6.1
Contributor guide
Assessment
This issue has not been assessed yet.