Details
-
Bug
-
Status: Resolved
-
Blocker
-
Resolution: Fixed
-
1.9.1
Description
`cast` function in blink planner and old planner are different:
in legacy planner:
cast('' as int) -> throw NumberFormatException
cast(null as int) -> throw NullPointerException
cast('abc' as int) -> throw NumberFormatException
but in blink planner:
cast('' as int) -> return null
cast(null as int) -> return null
cast('abc' as int) -> return null
A step forward:
```
create table source
;
select case when age < 20 then cast(id as bigint) else 0 end from source;
```
queries like above will throw NPE because we will try assign a `null` to a `long` field when the input satisfy `age < 20`.
Attachments
Issue Links
- links to