Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4810 DECIMAL datatype changes for Impala 2.9
  3. IMPALA-4811

Add strict mode tests for DECIMAL overflow of precision/scale in text file parsing

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.8.0
    • Fix Version/s: Impala 2.9.0
    • Component/s: Backend
    • Labels:
      None

      Description

      Similar to IMPALA-3579 but for DECIMAL type, when STRICT_MODE is enabled, we should error when the text value does not fit in the given DECIMAL type's precision or scale.

        Activity

        Hide
        dhecht Dan Hecht added a comment -

        Turns out that overflow/underflow when parsing always results in an error for decimal types:

        TextConverter::WriteSlot()
              if (parse_result != StringParser::PARSE_SUCCESS) {
                // Don't accept underflow and overflow for decimals.
                parse_result = StringParser::PARSE_FAILURE;
              }
        

        so all that needs to be done here is add some test coverage. I couldn't find existing coverage. I'll take care of it.

        Show
        dhecht Dan Hecht added a comment - Turns out that overflow/underflow when parsing always results in an error for decimal types: TextConverter::WriteSlot() if (parse_result != StringParser::PARSE_SUCCESS) { // Don't accept underflow and overflow for decimals. parse_result = StringParser::PARSE_FAILURE; } so all that needs to be done here is add some test coverage. I couldn't find existing coverage. I'll take care of it.
        Hide
        dhecht Dan Hecht added a comment -

        commit bf2e897209f1672073380665f84a4209be04b349
        Author: Dan Hecht <dhecht@cloudera.com>
        Date: Fri Feb 24 14:54:32 2017 -0800

        IMPALA-4810: add DECIMAL test case to strict_mode tests

        The string parsing code already errors if the decimal column either
        overflows or underflows (i.e. loses scale). Let's just add a test
        case.

        Change-Id: Idd66c0fb5a4d201919d39f73dea08b87339d6469
        Reviewed-on: http://gerrit.cloudera.org:8080/6150
        Reviewed-by: Dan Hecht <dhecht@cloudera.com>
        Tested-by: Impala Public Jenkins

        Show
        dhecht Dan Hecht added a comment - commit bf2e897209f1672073380665f84a4209be04b349 Author: Dan Hecht <dhecht@cloudera.com> Date: Fri Feb 24 14:54:32 2017 -0800 IMPALA-4810 : add DECIMAL test case to strict_mode tests The string parsing code already errors if the decimal column either overflows or underflows (i.e. loses scale). Let's just add a test case. Change-Id: Idd66c0fb5a4d201919d39f73dea08b87339d6469 Reviewed-on: http://gerrit.cloudera.org:8080/6150 Reviewed-by: Dan Hecht <dhecht@cloudera.com> Tested-by: Impala Public Jenkins

          People

          • Assignee:
            dhecht Dan Hecht
            Reporter:
            dhecht Dan Hecht
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development