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
accurateCastOrNull raises an exception, rather than simply returning null when casting an invalid value to Bool
Code: 467. DB::Exception: Received from 127.0.0.1:9000. DB::Exception: Cannot parse boolean value here: 'test', should be 'true' or 'false' controlled by setting bool_true_representation and bool_false_representation or one of True/False/T/F/Y/N/Yes/No/On/Off/Enable/Disable/Enabled/Disabled/1/0: While processing accurateCastOrNull('test', 'Bool'). (CANNOT_PARSE_BOOL)
Does it reproduce on recent release?
ClickHouse server version 22.7.1.906 (official build).
How to reproduce
select accurateCastOrNull('test', 'Bool')
Expected behavior
I expect it to behave the same as an invalid cast to something like UInt8
SELECT accurateCastOrNull('test', 'UInt8')
Query id: e7d0473b-6ae0-455d-9eae-fb3827e7c671
┌─accurateCastOrNull('test', 'UInt8')─┐
│ ᴺᵁᴸᴸ │
└─────────────────────────────────────┘
The text was updated successfully, but these errors were encountered:
@alexey-milovidov@antonio2368
I'm also experiencing this, and it's pretty easy to reproduce as well.
The work around that I found - which is suitable for our use case, doesn't mean it works for every case - is to use reinterpret which will return true if there's a value:
rschu1ze
added
bug
Confirmed user-visible misbehaviour in official release
and removed
potential bug
To be reviewed by developers and confirmed/rejected.
labels
Sep 15, 2023
Describe what's wrong
accurateCastOrNull raises an exception, rather than simply returning null when casting an invalid value to Bool
Does it reproduce on recent release?
ClickHouse server version 22.7.1.906 (official build).
How to reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: