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 B6BC3200D48 for ; Wed, 15 Nov 2017 00:51:41 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B5227160C07; Tue, 14 Nov 2017 23:51:41 +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 06641160BF4 for ; Wed, 15 Nov 2017 00:51:40 +0100 (CET) Received: (qmail 1726 invoked by uid 500); 14 Nov 2017 23:51:40 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 1714 invoked by uid 99); 14 Nov 2017 23:51:40 -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; Tue, 14 Nov 2017 23:51:40 +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 38CB51808A0 for ; Tue, 14 Nov 2017 23:51:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.363 X-Spam-Level: ** X-Spam-Status: No, score=2.363 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RDNS_DYNAMIC=0.363, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id sw0aXXrtSio1 for ; Tue, 14 Nov 2017 23:51:37 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id A02B05FC3F for ; Tue, 14 Nov 2017 23:51:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id vAENpa1P008348; Tue, 14 Nov 2017 23:51:36 GMT Message-Id: <201711142351.vAENpa1P008348@ip-10-146-233-104.ec2.internal> X-Gerrit-PatchSet: 3 Date: Tue, 14 Nov 2017 23:51:36 +0000 From: "Kim Jin Chul (Code Review)" To: Attila Jeges , Tim Armstrong , impala-cr@cloudera.com, reviews@impala.incubator.apache.org X-Gerrit-MessageType: newpatchset Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5237=3A_Support_a_quoted_string_in_date/time_format=0A?= X-Gerrit-Change-Id: Ie34055ac695748bcfb110bfa6ed5308f469ea178 X-Gerrit-Change-Number: 8508 X-Gerrit-ChangeURL: X-Gerrit-Commit: e7b3667335080936540460a73398041801203850 In-Reply-To: References: Reply-To: jinchul@gmail.com, impala-cr@cloudera.com, marcelk@gmail.com, tarmstrong@cloudera.com, attilaj@cloudera.com, reviews@impala.incubator.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.14.2 Content-Type: multipart/alternative; boundary="sjimHJGpJWA="; charset=UTF-8 archived-at: Tue, 14 Nov 2017 23:51:41 -0000 --sjimHJGpJWA= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Attila Jeges, Tim Armstrong, I'd like you to reexamine a change=2E = Please visit http://gerrit=2Ecloudera=2Eorg:8080/8508 to look at the = new patch set (#3)=2E Change subject: IMPALA-5237: Support a quoted string= in date/time format =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E= =2E=2E IMPALA-5237: Support a quoted string in date/time format Impala do= es not represent a quoted string at date/time format=2E For example, addtio= nal quoted string between the patterns (e=2Eg=2E HH\'H\' =3D> 11H)=2E Hive = supports this feature, so user wants to get a same result from Impala=2E By= the way, Impala returns a different result as below=2E * Hive > select fr= om_unixtime(1492677564, 'HH\'H\' mm\'M\' ss\'S\''); 08H 39M 24S * Impala >= select from_unixtime(1492677564, 'HH\'H\' mm\'M\' ss\'S\''); 08'8' 39'4' 2= 4'0' The change affects the format pattern for from_unixtime/from_timestam= p/unix_timestamp=2E In unix_timestamp, user can also specify a quoted stri= ng like this=2E > select unix_timestamp('\'Epoch time: \'19700101', > '\'E= poch time: \'yyyyMMdd'); 0 By the way, the quoted strings between input an= d format should be exactly same and internally string comparison is case-se= nsitive=2E There is one intentional difference between Hive and Impala=2E = In Impala, the format string should have any date or time patten as below= =2E Throwing the error/warning is better if Impala cannot optimize the expr= ession=2E User must rewrite the query and don't pay the function call=2E *= Hive > select from_unixtime(0, '\'Hello world!\''); Hello world! * Impala= > select from_unixtime(0, '\'Hello world!\''); Bad date/time conversion fo= rmat: 'Hello world!' Testing: Add unit tests for working and nonworking ca= ses Change-Id: Ie34055ac695748bcfb110bfa6ed5308f469ea178 --- M be/src/expr= s/expr-test=2Ecc M be/src/runtime/timestamp-parse-util=2Ecc M be/src/runtim= e/timestamp-parse-util=2Eh 3 files changed, 92 insertions(+), 2 deletions(-= ) git pull ssh://gerrit=2Ecloudera=2Eorg:29418/Impala-ASF refs/changes/= 08/8508/3 -- To view, visit http://gerrit=2Ecloudera=2Eorg:8080/8508 To un= subscribe, visit http://gerrit=2Ecloudera=2Eorg:8080/settings Gerrit-Proje= ct: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newpatchset Gerrit= -Change-Id: Ie34055ac695748bcfb110bfa6ed5308f469ea178 Gerrit-Change-Number:= 8508 Gerrit-PatchSet: 3 Gerrit-Owner: Kim Jin Chul G= errit-Reviewer: Attila Jeges Gerrit-Reviewer: Kim = Jin Chul Gerrit-Reviewer: Tim Armstrong --sjimHJGpJWA=--