Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
While calling Hive function, if the argument is void type, it will be considered as string type , which may bring wrong type inference and thus may well cause other problems.
For example,
timestamp(if(a = 0, null, a))
the argument for function `if` is `null` and `a`, null is void type, `a` is bigint type represents a timestamp, so the inferred return type should be bigint for the `if` function will ignore void type and just consider the other argument type. But we consider the void type as string type, the return type inferred will be string according to the `if` function inference logic.
And then when we try to converted the value returned by `if(a = 0, null, a)` to timestamp, the unexpected behavior will happen:
Since we infer the returned value of `if(a = 0, null, a)` as string, so `if(a = 0, null, a)` will return some thing like "1671058803926",but
cast ("1671058803926" as timestamp) will return null.
Attachments
Attachments
Issue Links
- fixes
-
FLINK-27374 Fix using wrong Flink type for Hive's void type
- Resolved
- links to