drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deneche A. Hakim (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-2001) Exception is thrown in arithmetic expression with MIN/MAX functions on a string type
Date Thu, 29 Jan 2015 17:00:38 GMT

    [ https://issues.apache.org/jira/browse/DRILL-2001?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14297136#comment-14297136
] 

Deneche A. Hakim commented on DRILL-2001:
-----------------------------------------

The logs contain the following exception:
{noformat}
java.lang.NumberFormatException: aaa
	at org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.nfeI(StringFunctionHelpers.java:96)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.varCharToInt(StringFunctionHelpers.java:121)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.test.generated.ProjectorGen1.doEval(ProjectorTemplate.java:71) ~[na:na]
	at org.apache.drill.exec.test.generated.ProjectorGen1.projectRecords(ProjectorTemplate.java:62)
~[na:na]
	at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.doWork(ProjectRecordBatch.java:174)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.record.AbstractSingleRecordBatch.innerNext(AbstractSingleRecordBatch.java:93)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.physical.impl.project.ProjectRecordBatch.innerNext(ProjectRecordBatch.java:134)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.record.AbstractRecordBatch.next(AbstractRecordBatch.java:142) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.physical.impl.validate.IteratorValidatorBatchIterator.next(IteratorValidatorBatchIterator.java:118)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:67) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.physical.impl.ScreenCreator$ScreenRoot.innerNext(ScreenCreator.java:97)
~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.physical.impl.BaseRootExec.next(BaseRootExec.java:57) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.work.fragment.FragmentExecutor.run(FragmentExecutor.java:110) ~[drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at org.apache.drill.exec.work.WorkManager$RunnableWrapper.run(WorkManager.java:254) [drill-java-exec-0.8.0-SNAPSHOT-rebuffed.jar:0.8.0-SNAPSHOT]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_71]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_71]
	at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
{noformat}

> Exception is thrown in 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
>
> 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)

Mime
View raw message