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 D100A17788 for ; Tue, 24 Feb 2015 21:32:05 +0000 (UTC) Received: (qmail 40053 invoked by uid 500); 24 Feb 2015 21:32:05 -0000 Delivered-To: apmail-drill-issues-archive@drill.apache.org Received: (qmail 39943 invoked by uid 500); 24 Feb 2015 21:32: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 39853 invoked by uid 99); 24 Feb 2015 21:32:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Feb 2015 21:32:05 +0000 Date: Tue, 24 Feb 2015 21:32:05 +0000 (UTC) From: "Chris Westin (JIRA)" To: issues@drill.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DRILL-2001) Poor error message when arithmetic expression with MIN/MAX functions on a string type 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-2001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14335493#comment-14335493 ] Chris Westin commented on DRILL-2001: ------------------------------------- This doesn't look like it's about MIN/MAX, or even the fact that there is an error: there should be an error, because you can't do arithmetic on a string. But the error is reported poorly, and the user might not understand what it means. > Poor error message when arithmetic expression with MIN/MAX functions on a string type > ------------------------------------------------------------------------------------- > > Key: DRILL-2001 > URL: https://issues.apache.org/jira/browse/DRILL-2001 > Project: Apache Drill > Issue Type: Bug > Components: Execution - Data Types > Affects Versions: 0.8.0 > Reporter: Victoria Markman > Priority: Minor > Fix For: Future > > > We do support MIN/MAX(). > However, if I inadvertently were to use this in arithmetic expression, I would get an exception: > {code} > { "a1": "aaa" } > { "a1": "bbb" } > { "a1": "bbb" } > { "a1": "eee" } > {code} > Works correctly: > {code} > 0: jdbc:drill:schema=dfs> select max(a1) from `t.json`; > +------------+ > | EXPR$0 | > +------------+ > | eee | > +------------+ > 1 row selected (0.085 seconds) > 0: jdbc:drill:schema=dfs> select min(a1) from `t.json`; > +------------+ > | EXPR$0 | > +------------+ > | aaa | > +------------+ > 1 row selected (0.104 seconds) > {code} > Throws an exception: > {code} > 0: jdbc:drill:schema=dfs> select min(a1)+1 from `t.json`; > +------------+ > | EXPR$0 | > +------------+ > Query failed: Query failed: Failure while running fragment., aaa [ 9194a73d-676d-4e63-8a49-a3c0ff0e63e0 on atsqa4-133.qa.lab:31010 ] > [ 9194a73d-676d-4e63-8a49-a3c0ff0e63e0 on atsqa4-133.qa.lab:31010 ] > java.lang.RuntimeException: java.sql.SQLException: Failure while executing query. > at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514) > at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148) > at sqlline.SqlLine.print(SqlLine.java:1809) > at sqlline.SqlLine$Commands.execute(SqlLine.java:3766) > at sqlline.SqlLine$Commands.sql(SqlLine.java:3663) > at sqlline.SqlLine.dispatch(SqlLine.java:889) > at sqlline.SqlLine.begin(SqlLine.java:763) > at sqlline.SqlLine.start(SqlLine.java:498) > at sqlline.SqlLine.main(SqlLine.java:460) > 0: jdbc:drill:schema=dfs> select max(a1)+1 from `t.json`; > +------------+ > | EXPR$0 | > +------------+ > Query failed: Query failed: Failure while running fragment., eee [ 23d7d06d-b93b-4cb0-a35b-c0fa0faf3369 on atsqa4-133.qa.lab:31010 ] > [ 23d7d06d-b93b-4cb0-a35b-c0fa0faf3369 on atsqa4-133.qa.lab:31010 ] > java.lang.RuntimeException: java.sql.SQLException: Failure while executing query. > at sqlline.SqlLine$IncrementalRows.hasNext(SqlLine.java:2514) > at sqlline.SqlLine$TableOutputFormat.print(SqlLine.java:2148) > at sqlline.SqlLine.print(SqlLine.java:1809) > at sqlline.SqlLine$Commands.execute(SqlLine.java:3766) > at sqlline.SqlLine$Commands.sql(SqlLine.java:3663) > at sqlline.SqlLine.dispatch(SqlLine.java:889) > at sqlline.SqlLine.begin(SqlLine.java:763) > at sqlline.SqlLine.start(SqlLine.java:498) > at sqlline.SqlLine.main(SqlLine.java:460) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)