Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-814

RexBuilder reverses precision and scale of DECIMAL literal

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      RexBuilder L850

       typeFactory.createSqlType(
                    SqlTypeName.DECIMAL, scale, precision);
      

      However, the createSqlType is accepting

      RelDataType createSqlType(
            SqlTypeName typeName,
            int precision,
            int scale);
      

      Need to swap the precision and scale

        Issue Links

          Activity

          Hide
          pxiong Pengcheng Xiong added a comment -

          Julian Hyde and Jesus Camacho Rodriguez, could u take a look? Thanks.

          Show
          pxiong Pengcheng Xiong added a comment - Julian Hyde and Jesus Camacho Rodriguez , could u take a look? Thanks.
          Hide
          julianhyde Julian Hyde added a comment -

          Looks like a serious bug. I wondered why we'd not hit it before, but that line of code is not hit in Calcite's test suite. I guess SqlToRelConverter uses a different code path to create literals.

          Show
          julianhyde Julian Hyde added a comment - Looks like a serious bug. I wondered why we'd not hit it before, but that line of code is not hit in Calcite's test suite. I guess SqlToRelConverter uses a different code path to create literals.
          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/67ea045c .
          Hide
          jnadeau Jacques Nadeau added a comment -

          Resolved in release 1.4.0-incubating (2015-08-23)

          Show
          jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              pxiong Pengcheng Xiong
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development