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 64850200BD0 for ; Wed, 30 Nov 2016 14:04:10 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 631E2160B13; Wed, 30 Nov 2016 13:04:10 +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 AB0A2160B08 for ; Wed, 30 Nov 2016 14:04:09 +0100 (CET) Received: (qmail 83247 invoked by uid 500); 30 Nov 2016 13:04:02 -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 83130 invoked by uid 99); 30 Nov 2016 13:03:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 13:03:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 662602C1F56 for ; Wed, 30 Nov 2016 13:03:58 +0000 (UTC) Date: Wed, 30 Nov 2016 13:03:58 +0000 (UTC) From: "Hive QA (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-15291) Comparison of timestamp fails if only date part is provided. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 30 Nov 2016 13:04:10 -0000 [ https://issues.apache.org/jira/browse/HIVE-15291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15708531#comment-15708531 ] Hive QA commented on HIVE-15291: -------------------------------- Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12841028/HIVE-15291.4.patch {color:green}SUCCESS:{color} +1 due to 2 test(s) being added or modified. {color:red}ERROR:{color} -1 due to 8 failed/errored test(s), 10750 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[sample2] (batchId=5) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[sample4] (batchId=15) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[sample6] (batchId=60) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[sample7] (batchId=59) org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver[sample9] (batchId=38) org.apache.hadoop.hive.cli.TestMiniLlapCliDriver.testCliDriver[transform_ppr2] (batchId=134) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_1] (batchId=91) org.apache.hadoop.hive.cli.TestMiniTezCliDriver.testCliDriver[explainanalyze_3] (batchId=91) {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/2342/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/2342/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-2342/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 8 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12841028 - PreCommit-HIVE-Build > Comparison of timestamp fails if only date part is provided. > ------------------------------------------------------------- > > Key: HIVE-15291 > URL: https://issues.apache.org/jira/browse/HIVE-15291 > Project: Hive > Issue Type: Bug > Components: Hive, UDF > Affects Versions: 2.1.0 > Reporter: Dhiraj Kumar > Assignee: Dhiraj Kumar > Attachments: HIVE-15291.1.patch, HIVE-15291.2.patch, HIVE-15291.3.patch, HIVE-15291.4.patch > > > Summary : If a query needs to compare two timestamp with one timestamp provided in "YYYY-MM-DD" format, skipping the time part, it returns incorrect result. > Steps to reproduce : > 1. Start a hive-cli. > 2. Fire up the query -> select cast("2016-12-31 12:00:00" as timestamp) > "2016-12-30"; > 3. Expected result : true > 4. Actual result : NULL > Detailed description : > If two primitives of different type needs to compared, a common comparator type is chosen. Prior to 2.1, Common type Text was chosen to compare Timestamp type and Text type. > In version 2.1, Common type Timestamp is chosen to compare Timestamp type and Text type. This leads to converting Text type (YYYY-MM-DD) into java.sql.Timestamp which throws exception saying the input is not in proper format. The exception is suppressed and a null is returned. > Code below from org.apache.hadoop.hive.ql.exec.FunctionRegistry > {code:java} > if (pgA == PrimitiveGrouping.STRING_GROUP && pgB == PrimitiveGrouping.DATE_GROUP) { > return b; > } > // date/timestamp is higher precedence than String_GROUP > if (pgB == PrimitiveGrouping.STRING_GROUP && pgA == PrimitiveGrouping.DATE_GROUP) { > return a; > } > {code} > The bug was introduced in [HIVE-13381|https://issues.apache.org/jira/browse/HIVE-13381] -- This message was sent by Atlassian JIRA (v6.3.4#6332)