Hive
  1. Hive
  2. HIVE-5726

The DecimalTypeInfo instance associated with a decimal constant is not in line with the precision/scale of the constant

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently Hive uses a default decimal type info instance to associate with a decimal constant in the expression tree. To precisely determine the precision/scale of the expression result requires more accurate precision/scale of the type of the decimal constant. Thus, Hive uses a precision/scale of the constant for the type info instance. As an example, the following is not desirable:

      hive> create table mytable as select 3.14BD as t from person_age limit 1;
      hive> desc mytable;
      OK
      t                   	decimal(65,30)      	None                
      Time taken: 0.08 seconds, Fetched: 1 row(s)
      

      instead, the precision/scale for t above should be (3, 2).

      1. HIVE-5726.1.patch
        6 kB
        Xuefu Zhang
      2. HIVE-5726.2.patch
        7 kB
        Xuefu Zhang
      3. HIVE-5726.patch
        4 kB
        Xuefu Zhang

        Issue Links

          Activity

          Hide
          Xuefu Zhang added a comment -

          Patch committed to trunk. Thanks go to Brock for the review.

          Show
          Xuefu Zhang added a comment - Patch committed to trunk. Thanks go to Brock for the review.
          Hide
          Brock Noland added a comment -

          Thank you!! +1

          Show
          Brock Noland added a comment - Thank you!! +1
          Hide
          Hive QA added a comment -

          Overall: +1 all checks pass

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12612312/HIVE-5726.2.patch

          SUCCESS: +1 4552 tests passed

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/146/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/146/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          

          This message is automatically generated.

          ATTACHMENT ID: 12612312

          Show
          Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12612312/HIVE-5726.2.patch SUCCESS: +1 4552 tests passed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/146/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/146/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated. ATTACHMENT ID: 12612312
          Hide
          Xuefu Zhang added a comment -

          Patch #4 updated based on RB feedback.

          Show
          Xuefu Zhang added a comment - Patch #4 updated based on RB feedback.
          Hide
          Brock Noland added a comment -

          Cancelling patch until feedback is addressed.

          Show
          Brock Noland added a comment - Cancelling patch until feedback is addressed.
          Hide
          Brock Noland added a comment -

          Feedback left on RB.

          Show
          Brock Noland added a comment - Feedback left on RB.
          Hide
          Xuefu Zhang added a comment -
          Show
          Xuefu Zhang added a comment - RB: https://reviews.apache.org/r/15217/
          Hide
          Brock Noland added a comment -

          I don't see the review board item for this?

          Show
          Brock Noland added a comment - I don't see the review board item for this?
          Hide
          Hive QA added a comment -

          Overall: +1 all checks pass

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12611782/HIVE-5726.1.patch

          SUCCESS: +1 4547 tests passed

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/123/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/123/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          

          This message is automatically generated.

          ATTACHMENT ID: 12611782

          Show
          Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12611782/HIVE-5726.1.patch SUCCESS: +1 4547 tests passed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/123/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/123/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated. ATTACHMENT ID: 12611782
          Hide
          Xuefu Zhang added a comment -

          Patch #1 fixed the test failure.

          Show
          Xuefu Zhang added a comment - Patch #1 fixed the test failure.
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12611675/HIVE-5726.patch

          ERROR: -1 due to 1 failed/errored test(s), 4547 tests executed
          Failed tests:

          org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_literal_decimal
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/120/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/120/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests failed with: TestsFailedException: 1 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12611675

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12611675/HIVE-5726.patch ERROR: -1 due to 1 failed/errored test(s), 4547 tests executed Failed tests: org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_literal_decimal Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/120/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/120/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests failed with: TestsFailedException: 1 tests failed This message is automatically generated. ATTACHMENT ID: 12611675

            People

            • Assignee:
              Xuefu Zhang
              Reporter:
              Xuefu Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development