Mihai Budiu created CALCITE-6379:
------------------------------------

             Summary: Arithmetic in Calcite does not produce results with the 
expected type
                 Key: CALCITE-6379
                 URL: https://issues.apache.org/jira/browse/CALCITE-6379
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.36.0
            Reporter: Mihai Budiu


This seems to be a very old bug in Calcite, which appears in SqlOperatorTest 
under the name FNL25. It has been around for at least 10 years, but it affects 
other parts of the code as well. I could not find a more precise description of 
this bug in the JIRA, so I am filing a new one. I think this is at least a 
critical bug.

The problem affects the expression evaluator in Calcite. After evaluating an 
arithmetic operation the result should be cast to the expected result type. For 
example, adding two SMALLINT values should cast the result to SMALLINT. 
Currently the code generated by the RexToLixTranslator is missing this cast. 
Since Java evaluation rules are different from SQL, many results are incorrect.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to