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

Mihai Budiu commented on CALCITE-5986:
--------------------------------------

RexLiteral also has a field typeName which has this comment:
{code:java}
  // TODO jvs 26-May-2006:  Use SqlTypeFamily instead; it exists
  // for exactly this purpose (to avoid the confusion which results
  // from overloading SqlTypeName).
  /**
   * An indication of the broad type of this literal -- even if its type isn't
   * a SQL type. Sometimes this will be different than the SQL type; for
   * example, all exact numbers, including integers have typeName
   * {@link SqlTypeName#DECIMAL}. See {@link #valueMatchesType} for the
   * definitive story.
   */ {code}
Indeed, I found the typeName field of RexLiteral quite confusing.

> The SqlTypeFamily for FP types is incorrect
> -------------------------------------------
>
>                 Key: CALCITE-5986
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5986
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>              Labels: pull-request-available
>
> In SqlTypeFamily we have this code:
> {code:java}
> private static final Map<Integer, SqlTypeFamily> JDBC_TYPE_TO_FAMILY =
> ...
>           .put(Types.FLOAT, NUMERIC)
>           .put(Types.REAL, NUMERIC)
>           .put(Types.DOUBLE, NUMERIC)
> {code}
> But it looks to me like the type family should be APPROXIMATE_NUMERIC.
> This impacts the way RelToSqlConverter works, for instance.



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

Reply via email to