[
https://issues.apache.org/jira/browse/CALCITE-6052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17776416#comment-17776416
]
Mihai Budiu commented on CALCITE-6052:
--------------------------------------
It looks like none of the special literals are supported textually (Infinity,
NaN).
-0E0 is the same as 0E0.
In Postgres the special literals are just written as strings:
https://www.postgresql.org/docs/current/datatype-numeric.html#DATATYPE-FLOAT
I suspect they are implicitly cast to the right values when necessary. Calcite
accepts CAST('Infinity' AS REAL), and does the right thing, as can be checked
using a SqlOperatorTest.
Moreover, this test in RelToSqlConverter will pass:
{code:java}
String query = "SELECT CAST(0.1E0 AS DOUBLE), CAST(0.1E0 AS REAL),
CAST(0.1E0 AS DOUBLE)";
String expected = "SELECT 1E-1, 1E-1, 1E-1";
sql(query).withMysql().ok(expected);
{code}
So literals of all 3 types are indistinguishable on output.
This happens because of [CALCITE-5987]
> SqlImplementor writes FLOATING POINT 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)