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 CF73F200C1B for ; Tue, 14 Feb 2017 13:40:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CE024160B52; Tue, 14 Feb 2017 12:40:46 +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 1FE5E160B5F for ; Tue, 14 Feb 2017 13:40:45 +0100 (CET) Received: (qmail 93838 invoked by uid 500); 14 Feb 2017 12:40:45 -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 93829 invoked by uid 99); 14 Feb 2017 12:40:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 12:40:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A4869C2046 for ; Tue, 14 Feb 2017 12:40:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Io8pI6CGFdyI for ; Tue, 14 Feb 2017 12:40:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7BEF45F659 for ; Tue, 14 Feb 2017 12:40:43 +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 89B85E0790 for ; Tue, 14 Feb 2017 12:40:42 +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 C1A0624129 for ; Tue, 14 Feb 2017 12:40:41 +0000 (UTC) Date: Tue, 14 Feb 2017 12:40:41 +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: Tue, 14 Feb 2017 12:40:47 -0000 [ https://issues.apache.org/jira/browse/HIVE-15229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Simanchal Das updated HIVE-15229: --------------------------------- Status: Patch Available (was: Open) > '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 > > > 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)