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 76F7B17DE9 for ; Fri, 13 Mar 2015 01:22:38 +0000 (UTC) Received: (qmail 21931 invoked by uid 500); 13 Mar 2015 01:22:38 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 21899 invoked by uid 500); 13 Mar 2015 01:22:38 -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 21884 invoked by uid 99); 13 Mar 2015 01:22:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Mar 2015 01:22:38 +0000 Date: Fri, 13 Mar 2015 01:22:38 +0000 (UTC) From: "Jason Altekruse (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-2101) Incorrect data type is written to parquet file when NULL is cast to decimal 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-2101?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14359738#comment-14359738 ] Jason Altekruse commented on DRILL-2101: ---------------------------------------- Please be sure to update the literal creation in the constant executor used by the constant folding rules once this is merged. See the comment in org.apache.drill.exec.planner.logical.DrillConstExecutor referencing this JIRA > Incorrect data type is written to parquet file when NULL is cast to decimal > --------------------------------------------------------------------------- > > Key: DRILL-2101 > URL: https://issues.apache.org/jira/browse/DRILL-2101 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Data Types > Affects Versions: 0.8.0 > Reporter: Victoria Markman > Assignee: Mehant Baid > Fix For: 0.9.0 > > Attachments: DRILL-2101-PARTIAL-PATCH-enable-decimal-literals.patch, DRILL-2101.patch > > > {code} > create table t1(c1) as > select > cast(null as decimal(28,4)) > from `t1.csv`; > message root { > optional double c1; <-- Wrong, should be decimal > } > {code} > This is very commonly used construct to convert csv files to parquet files, that's why I'm marking this bug as critical. > {code} > create table t2 as > select > case when columns[3] = '' then cast(null as decimal(28,4)) else cast(columns[3] as decimal(28, 4)) end > from `t1.csv`; > {code} > Correct - cast string literal to decimal > {code} > create table t3(c1) as > select > cast('12345678901234567890.1234' as decimal(28,4)) > from `t1.csv`; > message root { > required fixed_len_byte_array(12) c1 (DECIMAL(28,4)); > } > {code} > Correct - cast literal from csv file as decimal > {code} > create table t4(c1) as > select > cast(columns[3] as decimal(28,4)) > from `t1.csv`; > message root { > optional fixed_len_byte_array(12) c1 (DECIMAL(28,4)); > } > {code} > Correct - case statement (no null involved) > {code} > create table t5(c1) as > select > case when columns[3] = '' then cast('1111' as decimal(28,4)) else cast(columns[3] as decimal(28,4)) end > from `t1.csv`; > message root { > optional fixed_len_byte_array(12) c1 (DECIMAL(28,4)); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)