Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-6471

Different result for CAST String and Decimal literals as Decimal

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.14.0
    • 1.14.0
    • None
    • None

    Description

      If I cast String and Decimal literals as Decimal and literalĀ precision is more than I casting to,

      I see different results for the same literal data in String and Decimal formats

      SELECT cast('1234.5678' as DECIMAL(2, 2));

      +----------+
      | EXPR$0   |
      +----------+
      | 1200.00  |
      +----------+
      

      SELECT cast(1234.5678 as DECIMAL(2, 2));

      +---------+
      | EXPR$0  |
      +---------+
      | 0.12    |
      +---------+
      

      CAST result forĀ one number in String and Decimal formats should be the same.

      Attachments

        Issue Links

        Activity

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

          People

            volodymyr Vova Vysotskyi
            denysord88 Denys Ordynskiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment