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

Stamatis Zampetakis commented on CALCITE-7419:
----------------------------------------------

Is there a reason not support a limit for approximate numerics?

[~thomas.rebele] maybe you should share some info on how you were planning to 
use this method and what you expect as return values for the aforementioned 
data types.

> SqlTypeName#getLimit throws an AssertionError for FLOAT, DOUBLE, and REAL
> -------------------------------------------------------------------------
>
>                 Key: CALCITE-7419
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7419
>             Project: Calcite
>          Issue Type: Task
>            Reporter: Thomas Rebele
>            Priority: Minor
>
> The following code
> {code:java}
> SqlTypeName.FLOAT.getLimit(false, SqlTypeName.Limit.OVERFLOW, false, -1, -1);
> SqlTypeName.DOUBLE.getLimit(false, SqlTypeName.Limit.OVERFLOW, false, -1, -1);
> SqlTypeName.REAL.getLimit(false, SqlTypeName.Limit.OVERFLOW, false, -1, -1); 
> {code}
> leads to an exception:
> {code:java}
> java.lang.AssertionError: Was not expecting value 'FLOAT' for enumeration 
> 'org.apache.calcite.sql.type.SqlTypeName' in this context
>     at org.apache.calcite.util.Util.unexpected(Util.java:1937)
>     at org.apache.calcite.sql.type.SqlTypeName.getLimit(SqlTypeName.java:817) 
> {code}
> If the limit is not supported for these types, it should be mentioned in its 
> Javadoc.



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

Reply via email to