You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Victoria Markman (JIRA)" <ji...@apache.org> on 2015/10/08 22:35:27 UTC
[jira] [Commented] (DRILL-2001) Poor error message when arithmetic
expression with MIN/MAX functions on a string type
[ https://issues.apache.org/jira/browse/DRILL-2001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949346#comment-14949346 ]
Victoria Markman commented on DRILL-2001:
-----------------------------------------
in 1.2.0 we return a better error, however it should be a USER error and not a SYSTEM error:
{code}
0: jdbc:drill:schema=dfs> select min(a1)+1 from `t1.json`;
Error: SYSTEM ERROR: NumberFormatException: aaa
Fragment 0:0
[Error Id: 4623ffca-3b83-4d92-9c55-585fedb27789 on atsqa4-133.qa.lab:31010] (state=,code=0)
{code}
> 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: 1.4.0
>
>
> We do support MIN/MAX(<string data type>).
> 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)