[
https://issues.apache.org/jira/browse/TAJO-978?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14078795#comment-14078795
]
ASF GitHub Bot commented on TAJO-978:
-------------------------------------
Github user babokim commented on a diff in the pull request:
https://github.com/apache/tajo/pull/96#discussion_r15564108
--- Diff:
tajo-core/src/test/java/org/apache/tajo/engine/query/TestSelectQuery.java ---
@@ -470,4 +470,40 @@ public final void testNowInMultipleTasks() throws
Exception {
executeString("DROP TABLE table11 PURGE");
}
}
+
+ @Test
+ public void testCaseWhenRound() throws Exception {
--- End diff --
I'll add sql and result file.
> RoundFloat8 should return Float8Datum type.
> -------------------------------------------
>
> Key: TAJO-978
> URL: https://issues.apache.org/jira/browse/TAJO-978
> Project: Tajo
> Issue Type: Bug
> Reporter: Hyoungjun Kim
> Assignee: Hyoungjun Kim
> Priority: Minor
>
> Currently RoundFloat8 function returns TextDatum. So the following query
> occurs InvalidOperationException.
> {code:sql}
> select * from (
> select n_nationkey as key,
> case when n_nationkey < 6
> then round((n_nationkey * 100 / 2.123)::float4 /
> (n_regionkey + 1)::float4, 2)
> else 100.0
> end as val
> from nation) a
> order by a.key
> {code}
> {noformat}
> 2014-07-25 16:40:08,418 ERROR: org.apache.tajo.worker.Task (run(432)) -
> Cannot compare to FLOAT8 type datum
> org.apache.tajo.exception.InvalidOperationException: Cannot compare to FLOAT8
> type datum
> at org.apache.tajo.datum.TextDatum.compareTo(TextDatum.java:113)
> at
> org.apache.tajo.storage.TableStatistics.analyzeField(TableStatistics.java:91)
> at
> org.apache.tajo.storage.RawFile$RawFileAppender.addTuple(RawFile.java:600)
> at
> org.apache.tajo.engine.planner.physical.RangeShuffleFileWriteExec.next(RangeShuffleFileWriteExec.java:101)
> at org.apache.tajo.worker.Task.run(Task.java:425)
> at org.apache.tajo.worker.TaskRunner$1.run(TaskRunner.java:406)
> at java.lang.Thread.run(Thread.java:744)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)