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 54347200C42 for ; Sat, 25 Mar 2017 21:33:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 52CE4160B96; Sat, 25 Mar 2017 20:33:47 +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 98B5D160B6F for ; Sat, 25 Mar 2017 21:33:46 +0100 (CET) Received: (qmail 32066 invoked by uid 500); 25 Mar 2017 20:33:45 -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 32055 invoked by uid 99); 25 Mar 2017 20:33:45 -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; Sat, 25 Mar 2017 20:33:45 +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 3D674181069 for ; Sat, 25 Mar 2017 20:33:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id meDVD7woAH9n for ; Sat, 25 Mar 2017 20:33:44 +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 3A37B5FBB7 for ; Sat, 25 Mar 2017 20:33:44 +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 2E133E06CC 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 AE57024067 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] [Updated] (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:47 -0000 [ https://issues.apache.org/jira/browse/HIVE-15304?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Pengcheng Xiong updated HIVE-15304: ----------------------------------- Target Version/s: 2.1.2, 3.0.0 (was: 2.2.0, 2.1.2) > 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)