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 41EAB200C2B for ; Thu, 2 Mar 2017 16:27:49 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4074B160B61; Thu, 2 Mar 2017 15:27:49 +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 88982160B6F for ; Thu, 2 Mar 2017 16:27:48 +0100 (CET) Received: (qmail 19975 invoked by uid 500); 2 Mar 2017 15:27:47 -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 19966 invoked by uid 99); 2 Mar 2017 15:27:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Mar 2017 15:27:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 3D208C254D for ; Thu, 2 Mar 2017 15:27:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -2.347 X-Spam-Level: X-Spam-Status: No, score=-2.347 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-2.999, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id yDKCR1y8aRIO for ; Thu, 2 Mar 2017 15:27:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 315A95FDEA for ; Thu, 2 Mar 2017 15:27:46 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 9D7BEE05F7 for ; Thu, 2 Mar 2017 15:27:45 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 53CDB2415C for ; Thu, 2 Mar 2017 15:27:45 +0000 (UTC) Date: Thu, 2 Mar 2017 15:27:45 +0000 (UTC) From: "Simanchal Das (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HIVE-15229) 'like any' and 'like all' operators in hive MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Mar 2017 15:27:49 -0000 [ https://issues.apache.org/jira/browse/HIVE-15229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Simanchal Das updated HIVE-15229: --------------------------------- Attachment: HIVE-15229.5.patch > 'like any' and 'like all' operators in hive > ------------------------------------------- > > Key: HIVE-15229 > URL: https://issues.apache.org/jira/browse/HIVE-15229 > Project: Hive > Issue Type: New Feature > Components: Operators > Reporter: Simanchal Das > Assignee: Simanchal Das > Priority: Minor > Attachments: HIVE-15229.1.patch, HIVE-15229.2.patch, HIVE-15229.3.patch, HIVE-15229.4.patch, HIVE-15229.5.patch > > > In Teradata 'like any' and 'like all' operators are mostly used when we are matching a text field with numbers of patterns. > 'like any' and 'like all' operator are equivalents of multiple like operator like example below. > {noformat} > --like any > select col1 from table1 where col2 like any ('%accountant%', '%accounting%', '%retail%', '%bank%', '%insurance%'); > --Can be written using multiple like condition > select col1 from table1 where col2 like '%accountant%' or col2 like '%accounting%' or col2 like '%retail%' or col2 like '%bank%' or col2 like '%insurance%' ; > --like all > select col1 from table1 where col2 like all ('%accountant%', '%accounting%', '%retail%', '%bank%', '%insurance%'); > --Can be written using multiple like operator > select col1 from table1 where col2 like '%accountant%' and col2 like '%accounting%' and col2 like '%retail%' and col2 like '%bank%' and col2 like '%insurance%' ; > {noformat} > Problem statement: > Now a days so many data warehouse projects are being migrated from Teradata to Hive. > Always Data engineer and Business analyst are searching for these two operator. > If we introduce these two operator in hive then so many scripts will be migrated smoothly instead of converting these operators to multiple like operators. > Result: > 1. 'LIKE ANY' operator return true if a text(column value) matches to any pattern. > 2. 'LIKE ALL' operator return true if a text(column value) matches to all patterns. > 3. 'LIKE ANY' and 'LIKE ALL' returns NULL not only if the expression on the left hand side is NULL, but also if one of the pattern in the list is NULL. -- This message was sent by Atlassian JIRA (v6.3.15#6346)