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

Return type for SIGN function is incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • core

    Description

      It appears the metadata for the SIGN function in Calcite is incorrect, it uses the input metadata as the output metadata.

       SqlStdOperatorTable.java#L1713 

      This works in most cases but for Decimal where prec=scale, this doesn’t work since there can be no whole digits. The return metadata should really be an int, or if you want to match types then DECIMAL(1, 0) if the input metadata is any DECIMAL.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Juhwan Juhwan Kim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h