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 E3271200C42 for ; Sat, 25 Mar 2017 21:33:48 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E1E36160B6F; Sat, 25 Mar 2017 20:33:48 +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 33480160B88 for ; Sat, 25 Mar 2017 21:33:48 +0100 (CET) Received: (qmail 32196 invoked by uid 500); 25 Mar 2017 20:33:47 -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 32187 invoked by uid 99); 25 Mar 2017 20:33:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Mar 2017 20:33:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 86B4FC0758 for ; Sat, 25 Mar 2017 20:33:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 8rioUyUiBD9N for ; Sat, 25 Mar 2017 20:33:46 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id DCAA75FB02 for ; Sat, 25 Mar 2017 20:33:45 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 935F1E0B33 for ; Sat, 25 Mar 2017 20:33:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BDD5424073 for ; Sat, 25 Mar 2017 20:33:41 +0000 (UTC) Date: Sat, 25 Mar 2017 20:33:41 +0000 (UTC) From: "Pengcheng Xiong (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-15304) Implicit down cast should throw error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 25 Mar 2017 20:33:49 -0000 [ https://issues.apache.org/jira/browse/HIVE-15304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15941950#comment-15941950 ] Pengcheng Xiong commented on HIVE-15304: ---------------------------------------- Hello, I am deferring this to Hive 3.0 as we are going to cut the first RC and it is not marked as blocker. Please feel free to commit to the branch if this can be resolved before the release. > Implicit down cast should throw error > ------------------------------------- > > Key: HIVE-15304 > URL: https://issues.apache.org/jira/browse/HIVE-15304 > Project: Hive > Issue Type: Bug > Affects Versions: 0.13.0, 0.14.0, 0.13.1, 1.0.0, 1.2.0, 1.1.0, 1.0.1, 1.1.1, 1.2.1, 2.0.0, 2.1.0, 2.0.1, 2.1.1 > Reporter: Christian Zorneck > > Implicit down casts from a bigger numeric type to a smaller type should throw an error, when a numeric overflow happens. > Example: > CREATE TABLE downcast_test (int_value INT); > -- implicit cast to BIGINT and than implicit cast to INT > INSERT INTO TABLE downcast_test SELECT 2147483647 + 1; > -- implicit cast from BIGINT to INT > INSERT INTO TABLE downcast_test SELECT 2147483648L; > -- implicit cast from DOUBLE to INT > INSERT INTO TABLE downcast_test SELECT 2.147483648E9; > SELECT * FROM downcast_test; > => > -2147483648 -- expected int overflow value > -2147483648 -- expected int overflow value > 2147483647 -- what happend here? cast from DOUBLE to INT results in INT max value > Here you can see another nice bug with cast from DOUBLE to INT, but this is not the issue here. > Reading the following documentation > https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-AllowedImplicitConversions > implicit down casts from BIGINT and DOUBLE to INT are not allowed. So an exception is expected. But no exception will be thrown, it quite casts the values somehow down to INT -- This message was sent by Atlassian JIRA (v6.3.15#6346)