Description
In mysql comparisons if any of the entries are null, then the result is null.
https://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html and https://dev.mysql.com/doc/refman/5.0/en/type-conversion.html.
This can be demonstrated by the following mysql query:
mysql> select greatest(1, null) from test; +-------------------+ | greatest(1, null) | +-------------------+ | NULL | +-------------------+ 1 row in set (0.00 sec) mysql> select greatest(-1, null) from test; +--------------------+ | greatest(-1, null) | +--------------------+ | NULL | +--------------------+ 1 row in set (0.00 sec)
This is in contrast to Hive, where null are ignored in the comparisons.
hive> select greatest(null, 1) from test; OK 1
Attachments
Attachments
Issue Links
- is related to
-
HIVE-14189 backport HIVE-13945 to branch-1
- Patch Available
- relates to
-
HIVE-12070 Relax type restrictions on 'Greatest' and 'Least'
- Closed
-
HIVE-9402 Create GREATEST and LEAST udf
- Resolved
- links to