LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-116] java calc generates incorrect code for complex case statements #754

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[reporter="jpham", created="Sat, 29 Apr 2006 12:44:56 -0500 (GMT-05:00)"] alter system set "calcVirtualMachine"='CALCVM_JAVA';

create schema s;
set schema 's';

-- we don't rescale value here
values case when true then 123 else 10.5 end;
+---------+
| EXPR$0 |
+---------+
| 12.3 |
+---------+

-- this one doesn't compile
values case when true then 10.35 else 1.5e3 end;
0: jdbc:farrago:> Error: org.codehaus.janino.util.TunnelException: org.codehaus.janino.util.TunnelException: File /home/jpham/lu/farrago/./classes/net/sf/farrago/dynamic/stmt54873/ExecutableStmt.java, Line 95, Column 37: Cannot compare types "net.sf.farrago.dynamic.stmt54873.ExecutableStmt$Oj_inner_0" and "double" (state=,code=0)

-- fennel codegen is ok
alter system set "calcVirtualMachine"='CALCVM_FENNEL';

values case when true then 123 else 10.5 end;
+---------+
| EXPR$0 |
+---------+
| 123.0 |
+---------+

values case when true then 10.35 else 1.5e3 end;
+---------+
| EXPR$0 |
+---------+
| 10.35 |
+---------+

dynamobi-build commented 12 years ago

[author="jpham", created="Wed, 3 May 2006 16:55:48 -0500 (GMT-05:00)"] assigning to Xiaoyang for Java calc issues

dynamobi-build commented 12 years ago

[author="jpham", created="Thu, 18 May 2006 12:19:57 -0500 (GMT-05:00)"] This works in all branches as of 6621
(The fix may have come from dt integrations)