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

Casts to DECIMAL types are ignored

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The following SqlOperatorTest fails:

      f.checkScalar("CAST(1.123 AS DECIMAL(4, 0))", "1.0", "DECIMAL(4, 0) NOT NULL");
      

      The result computed by Calcite is 1.123, ignoring the scale of the DECIMAL result.
      Spark, Postgres, MySQL all return 1.0.

      I have marked this as a major bug.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mbudiu Mihai Budiu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment