[ https://issues.apache.org/jira/browse/CALCITE-6190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Nuyanzin closed CALCITE-6190. ------------------------------------ Resolved in release 1.37.0 (2024-05-06) > Incorrect precision derivation for negative numeric types > --------------------------------------------------------- > > Key: CALCITE-6190 > URL: https://issues.apache.org/jira/browse/CALCITE-6190 > Project: Calcite > Issue Type: Bug > Components: core > Affects Versions: 1.36.0 > Reporter: Evgeny Stanilovsky > Assignee: Mihai Budiu > Priority: Major > Labels: pull-request-available > Fix For: 1.37.0 > > > Test highlights the problem : > {code:java} > @Test void testTypeOfAs() { > sql("select DECIMAL '100.01' as c1 from (values (true))") > .columnType("DECIMAL(5, 2) NOT NULL"); > sql("select DECIMAL '-100.01' as c1 from (values (true))") > .columnType("DECIMAL(5, 2) NOT NULL"); > } > {code} > Throws exception for second expression: > {noformat} > Expected: is "DECIMAL(5, 2) NOT NULL" > but: was "DECIMAL(6, 2) NOT NULL" > {noformat} > Seems root cause in SqlLiteral#createExactNumeric precision derivation not > consider negative numbers. -- This message was sent by Atlassian Jira (v8.20.10#820010)