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

Drill allows to use decimal zero precision in CAST function for CTAS

    XMLWordPrintableJSON

Details

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

    Description

      I can run query with casting data for decimal with zero precision in SELECT statement

      select cast(1111.05 as decimal(0,5));
      
      +-------------+
      | EXPR$0      |
      +-------------+
      | 1111.05000  |
      +-------------+
      

      Also I can use this query for CTAS

      create table dfs.tmp.`zero_pr` as select cast(1111.05 as decimal(0,5));
      
      +----------+---------------------------+
      | Fragment | Number of records written |
      +----------+---------------------------+
      | 0_0      | 1                         |
      +----------+---------------------------+
      

      But when I try to select data from this table, I get an error:

      create table dfs.tmp.`zero_pr` as select cast(1111.05 as decimal(0,5));
      
      Error: SYSTEM ERROR: IllegalArgumentException: Invalid DECIMAL precision: 0 [Error Id: 2e320f55-aa65-4127-82be-6256e0744bdc on maprhost:31010] (state=,code=0)

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: