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 58F27200AE1 for ; Thu, 5 May 2016 20:52:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 577FF160A04; Thu, 5 May 2016 18:52:50 +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 9DD6C1609F9 for ; Thu, 5 May 2016 20:52:49 +0200 (CEST) Received: (qmail 395 invoked by uid 500); 5 May 2016 18:52:48 -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 Delivered-To: moderator for dev@hive.apache.org Received: (qmail 99974 invoked by uid 99); 5 May 2016 12:00:58 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ynfT3DQLBO1svK3lVRdh1SNgI17Ay8+inR31eqylvVM=; b=dWJOh2CekISgRtko0kkp86+r4e5h1Rb/49shFS2vlrIgHWDsoGJiaOT2BriDhPHDNG w5/f49w0CPQMEHsXC+1R7XtjiDJc93pPFIn18HJdgwxctBKpzb5CGffpnugaKrH7FTl4 6qAcq48irt+QOkFyLOzB5LpQ0hofxae3pjaPcBGk2b5o6DA/m9ur3d/u/2mADzpr08ej akvqgN259JdWb+GHCLMUS22Eo3h4EgcVJhQiDrVznMeUnB3Sb4m4VW3+WGV5OOacTI5v wXZcTuO4x32boe/t/QPDZkOdalhxkMQu5Hw6wPhIJPbtdZEIdrB4blbZaYDlRUJ7XMuv pGgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ynfT3DQLBO1svK3lVRdh1SNgI17Ay8+inR31eqylvVM=; b=ZcZVn8drN/Meo1KMPFonfD4b0msRwtpcEmNEdVq8+kqFzaoaumAE6EPB8XEjwBN3Kc +rDE2cMk6tJaqDKnD/OP5HvS9gZxdbf8wyUvTSG/JQIzCV+VOuZ+zjgF9dOEG+5EXQOu 0LafQt8AVAY+zSS8mKx+Q17TMT7JXHv6qu86nIDcTTWESscMymebgdmXT48NFowNg8E8 DYgyQwErOL4D5m1phA+ep1zq/xUataDdfKjdGn2VrBsLzq+yhfqQa9EZEyJtRxKGVM80 JmyzJDztJhjzSGpmCsqwbTBzqA7jvHEpRLWnlZkaTEIOtxT9rZbAYPTLLFoLWJcsEBLc A6mw== X-Gm-Message-State: AOPr4FVwZbEdY49Kgjx00BIrJwaBaLrwFpyw78h3kyq2/MHSl5JSEYQ2+2pbitn7d9tAiu/Ww0VwUo8ilO+KYw== MIME-Version: 1.0 X-Received: by 10.141.45.5 with SMTP id w5mr14231851qhe.1.1462449645742; Thu, 05 May 2016 05:00:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 5 May 2016 13:00:45 +0100 Message-ID: Subject: Re: Predicates for 'like' and 'between' operators to custom storage handler. From: Mich Talebzadeh To: user Cc: dev@hive.apache.org Content-Type: multipart/alternative; boundary=94eb2c115e72a2f2c90532171714 archived-at: Thu, 05 May 2016 18:52:50 -0000 --94eb2c115e72a2f2c90532171714 Content-Type: text/plain; charset=UTF-8 On a normal query using sql in* Hive 2* LIKE predicate works fine. Case in point in a 1 billion rows table with the column random_string of varchar(50) I have one row that satisfies the followinh@ +-----------+------------------+------------------+-------------------+-----------------------------------------------------+-----------------+----------------+--+ | dummy.id | dummy.clustered | dummy.scattered | dummy.randomised | dummy.random_string | dummy.small_vc | dummy.padding | +-----------+------------------+------------------+-------------------+-----------------------------------------------------+-----------------+----------------+--+ | 1 | 0 | 0 | 63 | rMLTDXxxqXOZnqYRJwInlGfGBTxNkAszBGEUGELqTSRnFjRGbi | 1 | xxxxxxxxxx | | 2 | 0 | 1 | 926 | UEDJsfIgoYqwreSuuvjIcPZarpxMdCthpDCsgPlJfvIiylLiBS | 2 | xxxxxxxxxx | Now let us try to select that row with LIKE predicate: 0: jdbc:hive2://rhes564:10010/default> select count(1) from dummy where random_string like 'rMLTDXxxqXOZnqYRJ%'; INFO : Query Hive on Spark job[0] stages: INFO : 0 INFO : 1 INFO : Status: Running (Hive on Spark job[0]) INFO : Completed executing command(queryId=hduser_20160505125700_cbc415b6-91bb-4ed6-95e4-d177e12988f6); Time taken: 153.544 seconds INFO : OK +-----+--+ | c0 | +-----+--+ | 1 | +-----+--+ 1 row selected (153.959 seconds) So it does work HTH Dr Mich Talebzadeh LinkedIn * https://www.linkedin.com/profile/view?id=AAEAAAAWh2gBxianrbJd6zP6AcPCCdOABUrV8Pw * http://talebzadehmich.wordpress.com On 5 May 2016 at 11:53, Amey Barve wrote: > Hi All, > > I have implemented custom storage-handler and able to get predicates from > hive for '=', '!=', '<', '<=', '>' and '>=' operators. > But I cannot get predicates from hive for 'like', 'between' operators. > > Here's my code: > > *final String expression = conf.get(TableScanDesc.FILTER_EXPR_CONF_STR);* > > here expression remains null for like and between operators but not null > for above operators. > > Does hive not give predicates for 'like' and 'between' operators to custom > storage handler ? > *Is there some other mechanism to get predicates for 'like' operator*? > > I tested with hive version 1.2 and 0.14. > > Thanks and Regards, > Amey > --94eb2c115e72a2f2c90532171714--