Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.36.0
Description
Clickhouse does not support the following EXTRACT Unit syntax, and ClickHouseSqlDialect may need some adaptation.
`SELECT EXTRACT(DOW FROM Date '2023-12-01')`
Syntax error: failed at position 20 ('FROM'):
SELECT EXTRACT(DOW FROM Date '2023-12-01');
Expected one of: UUID, NOT, AND, BETWEEN, ILIKE, IN, OR, alias, Arrow, AS, LIKE, token, MOD, DIV, NOT LIKE, NOT ILIKE, NOT IN, GLOBAL IN, GLOBAL NOT IN, IS, Comma, Dot, QuestionMark, DoubleColon, end of query
`SELECT EXTRACT(DOY FROM Date '2023-12-01')`
Syntax error: failed at position 20 ('FROM'):
SELECT EXTRACT(DOY FROM Date '2023-12-01');
Expected one of: UUID, NOT, AND, BETWEEN, ILIKE, IN, OR, alias, Arrow, AS, LIKE, token, MOD, DIV, NOT LIKE, NOT ILIKE, NOT IN, GLOBAL IN, GLOBAL NOT IN, IS, Comma, Dot, QuestionMark, DoubleColon, end of query
`SELECT EXTRACT(WEEK FROM Date '2023-12-01')`
Exception on client:
Code: 62. DB::Exception: The syntax 'EXTRACT(WEEK FROM date)' is not supported, cannot extract the number of a week