Failing SQL Feature
ClickHouse supports parametric (constructor-style) data types as the target of a CAST, including nested ones such as Nullable(Decimal(10, 2)). Here Decimal(10, 2) declares a decimal with precision 10 and scale 2, and Nullable(...) wraps it so the column can also hold NULL. JSQLParser fails to parse this type expression when it is used as the target type of a CAST(... AS ...).
See the ClickHouse docs:
Full SQL Example
CREATE TABLE cast_demo (id UInt32, x Float64) ENGINE = MergeTree ORDER BY id;
INSERT INTO cast_demo (id, x) VALUES (1, 10.5), (2, 3.14159), (3, 1234567.891), (4, 0);
SELECT CAST(x AS Nullable(Decimal(10, 2))) FROM cast_demo;
Parsing Error
ParseException: Encountered: <OPENING_BRACKET> / "(", at line 3, column 25, in lexical state DEFAULT.
Was expecting one of these terminals within expansion starting at 9127:5:
<K_FORMAT> (inside 9125:5) ...
<CLOSING_BRACKET> (inside 9127:5)
Tested with ClickHouse version: 25.8
Failing SQL Feature
ClickHouse supports parametric (constructor-style) data types as the target of a
CAST, including nested ones such asNullable(Decimal(10, 2)). HereDecimal(10, 2)declares a decimal with precision 10 and scale 2, andNullable(...)wraps it so the column can also hold NULL. JSQLParser fails to parse this type expression when it is used as the target type of aCAST(... AS ...).See the ClickHouse docs:
Full SQL Example
Parsing Error
Tested with ClickHouse version: 25.8