Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-20849

Sql. Incorrect result returns from CAST as DECIMAL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-beta1
    • None
    • sql
    • Docs Required, Release Notes Required

    Description

      After [1] will be merged, additional case need to be fixed:

      @Test
      public void test0() {
      List<List<Object>> res = sql("SElECT a::BIGINT FROM \n"
      + "(SELECT '111111111111111111111111111111111'::DECIMAL as a) t(a)");
      
      System.err.println("!!!: " + res);
      }
      
      return: 4553682020284002759

      The problem is :
      IgniteSqlValidator#literalCanFitType filter only
      INT_TYPES for now, seems need to be changed into NUMERIC_TYPES, after this change additional problem rised in min, max bound definition :
      org.apache.calcite.sql.type.SqlTypeName#getLimit - it works incorrect, need to be fixed
       
      [1] https://issues.apache.org/jira/browse/IGNITE-18662

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: