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 C63D410C49 for ; Sat, 6 Jun 2015 18:43:00 +0000 (UTC) Received: (qmail 34115 invoked by uid 500); 6 Jun 2015 18:43:00 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 34088 invoked by uid 500); 6 Jun 2015 18:43:00 -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 34079 invoked by uid 99); 6 Jun 2015 18:43:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Jun 2015 18:43:00 +0000 Date: Sat, 6 Jun 2015 18:43:00 +0000 (UTC) From: "Deneche A. Hakim (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DRILL-3259) cast_empty_string_to_null only works when set at SYSTEM level 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-3259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Deneche A. Hakim updated DRILL-3259: ------------------------------------ Attachment: twocols.csv attached csv file with 2 columns, one of them contains empty values > cast_empty_string_to_null only works when set at SYSTEM level > ------------------------------------------------------------- > > Key: DRILL-3259 > URL: https://issues.apache.org/jira/browse/DRILL-3259 > Project: Apache Drill > Issue Type: Bug > Affects Versions: 1.0.0 > Reporter: Deneche A. Hakim > Assignee: Deneche A. Hakim > Fix For: 1.2.0 > > Attachments: twocols.csv > > > When a CSV file contains "empty" values, the following query throws an exception: > {noformat} > select CAST(columns[1] as DOUBLE) FROM `twocols.csv`; > Error: SYSTEM ERROR: java.lang.NumberFormatException: empty String > (state=,code=0) > {noformat} > The problem, is that {{drill.exec.functions.cast_empty_string_to_null}} is only effective when changing the {{SYSTEM}} option and not the {{SESSION}} option: > {noformat} > 0: jdbc:drill:zk=local> select name, type, bool_val from sys.options where name like '%null%'; > +-------------------------------------------------+----------+-----------+ > | name | type | bool_val | > +-------------------------------------------------+----------+-----------+ > | drill.exec.functions.cast_empty_string_to_null | SYSTEM | false | > | drill.exec.functions.cast_empty_string_to_null | SESSION | true | > +-------------------------------------------------+----------+-----------+ > 2 rows selected (0.188 seconds) > 0: jdbc:drill:zk=local> select CAST(columns[1] as DOUBLE) FROM `twocols.csv`; > Error: SYSTEM ERROR: java.lang.NumberFormatException: empty String > {noformat} > {noformat} > 0: jdbc:drill:zk=local> select name, type, bool_val from sys.options where name like '%null%'; > +-------------------------------------------------+----------+-----------+ > | name | type | bool_val | > +-------------------------------------------------+----------+-----------+ > | drill.exec.functions.cast_empty_string_to_null | SYSTEM | true | > | drill.exec.functions.cast_empty_string_to_null | SESSION | false | > +-------------------------------------------------+----------+-----------+ > 2 rows selected (0.135 seconds) > 0: jdbc:drill:zk=local> select CAST(columns[1] as DOUBLE) FROM `twocols.csv`; > +----------+ > | EXPR$0 | > +----------+ > | 143.0 | > | 104.0 | > | 46.0 | > | 387.0 | > | 23.0 | > | 112.0 | > | null | > | 76.0 | > | null | > | 1225.0 | > | null | > | null | > | null | > | 13.0 | > | 49.0 | > | 108.0 | > | 13.0 | > | 33.0 | > | null | > | null | > | 10.0 | > | null | > | null | > | null | > | 145.0 | > | null | > | 24.0 | > | 614.0 | > | null | > | null | > | null | > | 59.0 | > | 262.0 | > | 3.0 | > | 14022.0 | > | 4812.0 | > | 14219.0 | > | 1365.0 | > | null | > | 1531.0 | > | null | > | 3736.0 | > | 11327.0 | > | 3115.0 | > | null | > | 11713.0 | > | null | > | 3410.0 | > | null | > | null | > | 1620.0 | > | 9675.0 | > | 6250.0 | > | null | > | 1625.0 | > | null | > | 5112.0 | > | 924.0 | > | 4150.0 | > | 2920.0 | > | null | > | 1253.0 | > | 4108.0 | > | 2703.0 | > | 3524.0 | > | null | > | null | > | 3921.0 | > | 4529.0 | > | null | > | null | > | 4672.0 | > | 2125.0 | > | null | > | null | > | 706.0 | > | 80.0 | > | null | > | null | > | 457.0 | > | 8530.0 | > | null | > | 262.0 | > | 760.0 | > | null | > | 791.0 | > | 12816.0 | > | 883.0 | > | 1836.0 | > | 477.0 | > | 1240.0 | > | 107.0 | > | 1200.0 | > | 198.0 | > | 624.0 | > | null | > | 40.0 | > | 11.0 | > | 338.0 | > +----------+ > 99 rows selected (0.096 seconds) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)