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

Different result for CAST String and Decimal literals as Decimal

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.14.0
    • Fix Version/s: 1.14.0
    • Component/s: None
    • Labels:
      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

              People

              • Assignee:
                vvysotskyi Volodymyr Vysotskyi
                Reporter:
                denysord88 Denys Ordynskiy
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: