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 389FC200C5E for ; Sat, 22 Apr 2017 13:03:36 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 37279160B96; Sat, 22 Apr 2017 11:03:36 +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 55B39160B93 for ; Sat, 22 Apr 2017 13:03:35 +0200 (CEST) Received: (qmail 27163 invoked by uid 500); 22 Apr 2017 11:03:34 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 27151 invoked by uid 99); 22 Apr 2017 11:03:33 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Apr 2017 11:03:33 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 949DD18033C; Sat, 22 Apr 2017 11:03:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3 X-Spam-Level: *** X-Spam-Status: No, score=3 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ChzUHDkvNZxN; Sat, 22 Apr 2017 11:03:31 +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 ED6105FC4F; Sat, 22 Apr 2017 11:03:30 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 39EF2E0041; Sat, 22 Apr 2017 11:03:30 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id F0A6EC402DA; Sat, 22 Apr 2017 11:03:29 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0906254325102108444==" MIME-Version: 1.0 Subject: Re: Review Request 53845: 'like any' and 'like all' operators in hive From: Simanchal Das To: Vineet Garg , Carl Steinbach Cc: hive , Simanchal Das , Carl Steinbach Date: Sat, 22 Apr 2017 11:03:29 -0000 Message-ID: <20170422110329.23980.7969@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Simanchal Das X-ReviewGroup: hive X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/53845/ X-Sender: Simanchal Das References: <20170302152613.39766.49144@reviews-vm2.apache.org> In-Reply-To: <20170302152613.39766.49144@reviews-vm2.apache.org> X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/udf_likeall.q.out X-ReviewBoard-Diff-For: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLikeAny.java X-ReviewBoard-Diff-For: ql/src/test/results/clientnegative/udf_likeany_wrong1.q.out X-ReviewBoard-Diff-For: ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLikeAny.java X-ReviewBoard-Diff-For: ql/src/test/queries/clientnegative/udf_likeall_wrong1.q X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/udf_likeany.q X-ReviewBoard-Diff-For: ql/src/test/queries/clientnegative/udf_likeany_wrong1.q X-ReviewBoard-Diff-For: ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLikeAll.java X-ReviewBoard-Diff-For: ql/src/test/queries/clientpositive/udf_likeall.q X-ReviewBoard-Diff-For: ql/src/test/results/clientpositive/udf_likeany.q.out X-ReviewBoard-Diff-For: ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLikeAll.java X-ReviewBoard-Diff-For: ql/src/test/results/clientnegative/udf_likeall_wrong1.q.out Reply-To: Simanchal Das X-ReviewRequest-Repository: hive-git archived-at: Sat, 22 Apr 2017 11:03:36 -0000 --===============0906254325102108444== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/53845/ ----------------------------------------------------------- (Updated April 22, 2017, 11:03 a.m.) Review request for hive, Carl Steinbach and Vineet Garg. Repository: hive-git Description ------- https://issues.apache.org/jira/browse/HIVE-15229 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. --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%' ; 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. Diffs (updated) ----- ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 8dc5f2e ql/src/java/org/apache/hadoop/hive/ql/parse/HiveLexer.g 0721b92 ql/src/java/org/apache/hadoop/hive/ql/parse/HiveParser.g d98a663 ql/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g 8598fae ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 8f8eab0 ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLikeAll.java PRE-CREATION ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFLikeAny.java PRE-CREATION ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLikeAll.java PRE-CREATION ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFLikeAny.java PRE-CREATION ql/src/test/queries/clientnegative/udf_likeall_wrong1.q PRE-CREATION ql/src/test/queries/clientnegative/udf_likeany_wrong1.q PRE-CREATION ql/src/test/queries/clientpositive/udf_likeall.q PRE-CREATION ql/src/test/queries/clientpositive/udf_likeany.q PRE-CREATION ql/src/test/results/clientnegative/udf_likeall_wrong1.q.out PRE-CREATION ql/src/test/results/clientnegative/udf_likeany_wrong1.q.out PRE-CREATION ql/src/test/results/clientpositive/show_functions.q.out ac5ca41 ql/src/test/results/clientpositive/udf_likeall.q.out PRE-CREATION ql/src/test/results/clientpositive/udf_likeany.q.out PRE-CREATION Diff: https://reviews.apache.org/r/53845/diff/9/ Changes: https://reviews.apache.org/r/53845/diff/8-9/ Testing ------- Junit test cases and query.q files are attached Thanks, Simanchal Das --===============0906254325102108444==--