Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DD0EB10A09 for ; Wed, 7 Aug 2013 22:18:49 +0000 (UTC) Received: (qmail 80350 invoked by uid 500); 7 Aug 2013 22:18:49 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 80298 invoked by uid 500); 7 Aug 2013 22:18:49 -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 80289 invoked by uid 500); 7 Aug 2013 22:18:49 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 80286 invoked by uid 99); 7 Aug 2013 22:18:49 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Aug 2013 22:18:49 +0000 Date: Wed, 7 Aug 2013 22:18:49 +0000 (UTC) From: "Jason Dere (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-3191) timestamp - timestamp causes null pointer exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-3191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13732833#comment-13732833 ] Jason Dere commented on HIVE-3191: ---------------------------------- Looking at the diff, I think timestamp - timestamp should not return a timestamp result, as you can see in the test case the results formatted to string don't look correct ('2011-01-01 01:01:02.4567 - '1970-01-01 01:01:01.5678' = 2011-01-01 00:00:00.8889). Date/timestamp arithmetic should be really be returning an INTERVAL type as the result. So let's do the quick fix to avoid NPE here, and hopefully support interval data type in future work. In the meantime users can cast/convert the timestamp to a numeric value and perform arithmetic operations. > timestamp - timestamp causes null pointer exception > --------------------------------------------------- > > Key: HIVE-3191 > URL: https://issues.apache.org/jira/browse/HIVE-3191 > Project: Hive > Issue Type: Bug > Affects Versions: 0.8.0 > Reporter: N Campbell > > select tts.rnum, tts.cts - tts.cts from cert.tts tts > Error: Query returned non-zero code: 12, cause: FAILED: Hive Internal Error: java.lang.NullPointerException(null) > SQLState: 42000 > ErrorCode: 12 > create table if not exists CERT.TTS ( RNUM int , CTS timestamp) > stored as sequencefile; -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira