You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix negative literal handling in :: cast expressions
When parsing expressions like -0::Int16, ClickHouse keeps the minus
sign with the literal so it becomes CAST('-0', 'Int16'). Previously
we parsed this as negate(CAST(0, Int16)).
Changes:
- Modified parseUnaryMinus to detect -number::type pattern and keep
them together as a signed literal
- Added Negative field to ast.Literal to track explicitly negative
literals (needed for -0 which equals 0 numerically)
- Updated formatExprAsString to handle Negative flag and output the
original signed representation
0 commit comments