Return-Path: X-Original-To: apmail-drill-issues-archive@minotaur.apache.org Delivered-To: apmail-drill-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99BD918EF2 for ; Wed, 15 Jul 2015 00:04:06 +0000 (UTC) Received: (qmail 49218 invoked by uid 500); 15 Jul 2015 00:04:05 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 49042 invoked by uid 500); 15 Jul 2015 00:04:05 -0000 Mailing-List: contact issues-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list issues@drill.apache.org Received: (qmail 48816 invoked by uid 99); 15 Jul 2015 00:04:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jul 2015 00:04:05 +0000 Date: Wed, 15 Jul 2015 00:04:05 +0000 (UTC) From: "Sudheesh Katkam (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (DRILL-591) explicit cast fail to convert 0.00000001 to int 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/DRILL-591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sudheesh Katkam closed DRILL-591. --------------------------------- > explicit cast fail to convert 0.00000001 to int > ----------------------------------------------- > > Key: DRILL-591 > URL: https://issues.apache.org/jira/browse/DRILL-591 > Project: Apache Drill > Issue Type: Bug > Components: Functions - Drill > Reporter: Chun Chang > Assignee: Sudheesh Katkam > Fix For: 0.4.0 > > > The following number can be converted to int 0 on postgres: > foodmart=# select c_decimal9 from data where c_row =6; > c_decimal9 > ------------ > 0.00000001 > (1 row) > foodmart=# select cast(c_decimal9 as int) from data where c_row = 6; > c_decimal9 > ------------ > 0 > (1 row) > But with Drill, it fails: > 0: jdbc:drill:schema=dfs> select cast(c_decimal9 as varchar(20)) from data where c_row =6; > +------------+ > | EXPR$0 | > +------------+ > | 0.00000001 | > +------------+ > 1 row selected (0.117 seconds) > 0: jdbc:drill:schema=dfs> select cast(c_decimal9 as int) from data where c_row = 6; > Query failed: org.apache.drill.exec.rpc.RpcException: Remote failure while running query.[error_id: "ae039e8f-1c9a-435c-92fe-d4f0b7614cb8" > endpoint { > address: "qa-node118.qa.lab" > user_port: 31010 > control_port: 31011 > data_port: 31012 > } > error_type: 0 > message: "Failure while running fragment. < NumberFormatException:[ 0.00000001 ]" > ] > Error: exception while executing query (state=,code=0) -- This message was sent by Atlassian JIRA (v6.3.4#6332)