You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "duan xiong (Jira)" <ji...@apache.org> on 2021/10/07 17:09:00 UTC
[jira] [Created] (CALCITE-4838) add roundingMode in SqlConformance
to document how to cast an approximate numeric to int
duan xiong created CALCITE-4838:
-----------------------------------
Summary: add roundingMode in SqlConformance to document how to cast an approximate numeric to int
Key: CALCITE-4838
URL: https://issues.apache.org/jira/browse/CALCITE-4838
Project: Calcite
Issue Type: Bug
Components: core
Affects Versions: 1.27.0
Reporter: duan xiong
Assignee: duan xiong
According to the SQL Strandard about how to cast an approximate numeric to int in different database have different RoundingMode. for example:
In PostgreSQL、Mysql、Oracle(RoundingMode.UP):
{code:java}
select cast(5.1 as int) return 5
select cast(5.5 as int) return 6
{code}
In Calcite、Sql Server 2008(RoundingMode.DOWN):
{code:java}
select cast(5.1 as int) return 5
select cast(5.5 as int) return 5
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)