Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4653200B9C for ; Fri, 2 Sep 2016 01:22:28 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DAC5E160AB7; Thu, 1 Sep 2016 23:22:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2F296160AB5 for ; Fri, 2 Sep 2016 01:22:23 +0200 (CEST) Received: (qmail 49868 invoked by uid 500); 1 Sep 2016 23:22:22 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 49646 invoked by uid 99); 1 Sep 2016 23:22:22 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 23:22:22 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E0BDA2C1B8A for ; Thu, 1 Sep 2016 23:22:21 +0000 (UTC) Date: Thu, 1 Sep 2016 23:22:21 +0000 (UTC) From: "Zoltan Haindrich (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-13555) Add nullif udf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 01 Sep 2016 23:22:29 -0000 [ https://issues.apache.org/jira/browse/HIVE-13555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] 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. however...ibm things the 2 types should be casted in any way it's possible (patch#1) https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.sqls.doc/ids_sqs_1446.htm oracle does only note to cast numeric datatypes (#1 or #2) https://docs.oracle.com/database/121/SQLRF/functions128.htm 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: https://issues.apache.org/jira/browse/HIVE-13555 > 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 (v6.3.4#6332)