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

Mihai Budiu commented on CALCITE-6052:
--------------------------------------

This is a funny one: there is this code in AbstractSqlTester:

{code:java}
  @Override public void forEachQuery(SqlTestFactory factory,
      String expression, Consumer<String> consumer) {
    // Why not return a list? If there is a syntax error in the expression, the
    // consumer will discover it before we try to parse it to do substitutions
    // on the parse tree.
    consumer.accept("values (" + expression + ")");
    consumer.accept(buildQuery2(factory, expression));
  }
{code}

It turns out that these two never agree for this one test:

{code:java}
f.checkScalarApprox("CAST('-0E0' AS REAL)",
        "REAL NOT NULL", "-0E0");
{code}

one of them expects a result of -0.0, while the other expects a result of 0.0.

This signals that there is at least one more bug somewhere

A cowardly solution would be to use checkScalarApprox allowing a rounding 
error, but I suspect that's not what we are looking for.

> SqlImplementor writes REAL, FLOAT, or DOUBLE literals as DECIMAL literals
> -------------------------------------------------------------------------
>
>                 Key: CALCITE-6052
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6052
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: Mihai Budiu
>            Assignee: Mihai Budiu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.36.0
>
>
> This bug is already fixed in https://github.com/apache/calcite/pull/3411, but 
> I plan to submit a smaller point fix for it, which doesn't require reworking 
> the type families.



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

Reply via email to