hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zoltan Haindrich (JIRA)" <>
Subject [jira] [Updated] (HIVE-13555) Add nullif udf
Date Thu, 01 Sep 2016 23:22:21 GMT


Zoltan Haindrich updated HIVE-13555:
    Attachment: HIVE-13555.2.patch

[~ashutoshc] i've made it more strict...I think it will be more safer this way too 

patch#2 will refuse to use different primitive type groups at the same time.

so: {{nullif('x',1)}} is invalid...for postgres this was invalid too, but psql interpreted
{{nullif('1',1)}} as a valid...I think refusing to cast string all the way it's possible may
cover user problems. things the 2 types should be casted in any way it's possible (patch#1)

oracle does only note to cast numeric datatypes (#1 or #2)
however...this will do between all the other primitive types; I think that's fair - and i've
adopted to only compare unknown types if they are the same.

i'm rejecting the VOID_GROUP as first argument...
because {{NULLIF(NULL,x)}} has no real use - and oracle have noted this explicitly...putting
a null literal there must be a mistake.

I don't have a working set of sql servers to peek around now ;)

> Add nullif udf
> --------------
>                 Key: HIVE-13555
>                 URL:
>             Project: Hive
>          Issue Type: Sub-task
>          Components: UDF
>            Reporter: Ashutosh Chauhan
>            Assignee: Zoltan Haindrich
>         Attachments: HIVE-13555.1.patch, HIVE-13555.2.patch
> {{nullif(exp1, exp2)}} is shorthand for: {{case when exp1 = exp2 then null else exp1}}

This message was sent by Atlassian JIRA

View raw message