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 CBE441744A for ; Fri, 17 Apr 2015 17:14:59 +0000 (UTC) Received: (qmail 98856 invoked by uid 500); 17 Apr 2015 17:14:59 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 98723 invoked by uid 500); 17 Apr 2015 17:14:59 -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 98576 invoked by uid 99); 17 Apr 2015 17:14:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2015 17:14:59 +0000 Date: Fri, 17 Apr 2015 17:14:59 +0000 (UTC) From: "Victoria Markman (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (DRILL-2084) Order by on date, time, timestamp and boolean columns produces wrong results if column contains null values 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-2084?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Victoria Markman closed DRILL-2084. ----------------------------------- > Order by on date, time, timestamp and boolean columns produces wrong results if column contains null values > ----------------------------------------------------------------------------------------------------------- > > Key: DRILL-2084 > URL: https://issues.apache.org/jira/browse/DRILL-2084 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Data Types > Affects Versions: 0.8.0 > Reporter: Victoria Markman > Assignee: Daniel Barclay (Drill) > Priority: Critical > Fix For: 0.8.0 > > Attachments: 0_0_0.parquet, boolean.out, date.out, t1.csv, time.out, timestamp.out > > > Nulls are neither sorted at the end or beginning of the table, they appear in the middle. > I created table using parquet format from t1.csv file. > Here is create table statement I used to create table that is used in the queries: > {code} > create table t1(c_varchar, c_integer, c_bigint, c_smalldecimal, c_bigdecimal, c_float, c_date, c_time, c_timestamp, c_boolean) as > select > case when columns[0] = '' then cast(null as varchar(255)) else cast(columns[0] as varchar(255)) end, > case when columns[1] = '' then cast(null as integer) else cast(columns[1] as integer) end, > case when columns[2] = '' then cast(null as bigint) else cast(columns[2] as bigint) end, > case when columns[3] = '' then cast(null as decimal(18,4)) else cast(columns[3] as decimal(18, 4)) end, > case when columns[4] = '' then cast(null as decimal(38,4)) else cast(columns[4] as decimal(38, 4)) end, > case when columns[5] = '' then cast(null as float) else cast(columns[5] as float) end, > case when columns[6] = '' then cast(null as date) else cast(columns[6] as date) end, > case when columns[7] = '' then cast(null as time) else cast(columns[7] as time) end, > case when columns[8] = '' then cast(null as timestamp) else cast(columns[8] as timestamp) end, > case when columns[9] = '' then cast(null as boolean) else cast(columns[9] as boolean) end > from `t1.csv`; > {code} > Failing queries are: > {code} > select c_date from t1 order by c_date; > select c_time from t1 order by c_time; > select c_timestamp from t1 order by c_timestamp; > select c_boolean from t1 order by c_boolean; > {code} > If you add 'IS NULL' or 'IS NOT NULL' predicates to the queries above, you will get correct results. > I will attach all the relevant files to this bug. -- This message was sent by Atlassian JIRA (v6.3.4#6332)