You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Evgeny Stanilovsky (Jira)" <ji...@apache.org> on 2024/01/08 11:34:00 UTC

[jira] [Created] (IGNITE-21210) Sql. Incorrect precision derivation for negative numeric types

Evgeny Stanilovsky created IGNITE-21210:
-------------------------------------------

             Summary: Sql. Incorrect precision derivation for negative numeric types
                 Key: IGNITE-21210
                 URL: https://issues.apache.org/jira/browse/IGNITE-21210
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 3.0.0-beta1
            Reporter: Evgeny Stanilovsky


Seems precision for negative numeric types derived erroneously.


{noformat}
    @Test
    public void testLiteralTypeMatch() throws Exception {
        String query = "SELECT -1.1, DECIMAL '-1.1'";

        IgniteRel rel = physicalPlan(query, new IgniteSchema(DEFAULT_SCHEMA, 1, List.of()));

        RelDataType numericLitType = rel.getRowType().getFieldList().get(0).getType();
        RelDataType decimalLitType = rel.getRowType().getFieldList().get(1).getType();

        assertEquals(numericLitType, decimalLitType);
    }
{noformat}

throws on comparison:

{noformat}
Expected :DECIMAL(2, 1)
Actual   :DECIMAL(3, 1)
{noformat}




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