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

Decimal type scale and precision are being flipped sometime during a cast

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.7.0
    • Execution - Data Types
    • None

    Description

      Running this query I was trying to test the behavior of the test framework to allow checking a baseline file, without providing type information for each column in a csv. The idea is that the types that come out of the test query can drive the interpretation of the baseline where strict type checking isn't necessary. Unfortunately I ran into a bug when I was trying to make sure decimal scale and precision could be retrieved from a result set with a decimal column. It appears that the two values are being switched somewhere in the process of running a cast. I plan on fixing this soon, but wanted to create a JIRA to track the issue so I can post the patch for the test framework for review.

      To replicate:
      select cast(dec_col as decimal(38,2)) dec_col from cp.`testframework/decimal_test.json`

      The file need only contain a single decimal in a field called dec_col in the input file. I used a value of "3.7"

      Attachments

        Activity

          People

            jaltekruse Jason Altekruse
            jaltekruse Jason Altekruse
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: