Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Hive throws exception when null is passed as a parameter of trim/rtrim/ltrim
select trim(null);
org.apache.hadoop.hive.ql.parse.SemanticException: Line 1:7 Wrong arguments 'TOK_NULL': trim takes only STRING/CHAR/VARCHAR types. Found VOID
However null should be returned. From SQL11 standard:
a) Let S be the value of the <trim source>.
b) If <trim character> is specified, then let SC be the value of <trim character>; otherwise, let SC be
<space>.
c) If at least one of S and SC is the null value, then the result of the <trim function> is the null value.
Attachments
Issue Links
- is related to
-
HIVE-24565 Implement standard trim function
- Resolved
- links to