Hive
  1. Hive
  2. HIVE-7306

Ineffective null check in GenericUDAFAverage#GenericUDAFAverageEvaluatorDouble#getNextResult()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 0.13.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

                  Object[] o = ss.intermediateVals.remove(0);
                  Double d = o == null ? 0.0 : (Double) o[0];
                  r = r == null ? null : r - d;
                  cnt = cnt - ((Long) o[1]);
      

      Array o is accessed without null check in the last line above.

        Issue Links

          Activity

          Ted Yu created issue -
          Hide
          Ted Yu added a comment -

          Similar problem exists in GenericUDAFAverage#GenericUDAFAverageEvaluatorDecimal as well.

          Show
          Ted Yu added a comment - Similar problem exists in GenericUDAFAverage#GenericUDAFAverageEvaluatorDecimal as well.
          Hide
          skrho added a comment -

          Here is patch...

          I chanaged null check logic using if/else statement

          Please review my source..and give me a chance to contribute source

          Show
          skrho added a comment - Here is patch... I chanaged null check logic using if/else statement Please review my source..and give me a chance to contribute source
          skrho made changes -
          Field Original Value New Value
          Attachment HIVE-7306.patch [ 12665747 ]
          skrho made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Affects Version/s 0.13.1 [ 12326829 ]
          Labels patch
          skrho made changes -
          Attachment HIVE-7306.patch [ 12665747 ]
          Hide
          skrho added a comment -

          Here is my patch.. I changed null checker position to effect null check..

          Show
          skrho added a comment - Here is my patch.. I changed null checker position to effect null check..
          skrho made changes -
          Attachment HIVE-7306.patch [ 12665748 ]
          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/12665748/HIVE-7306.patch

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

          org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing
          org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing_windowspec
          org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_0_5
          org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_3_0
          org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_3_4
          org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_7_2
          org.apache.hive.hcatalog.pig.TestOrcHCatLoader.testReadDataPrimitiveTypes
          org.apache.hive.jdbc.miniHS2.TestHiveServer2.testConnection
          

          Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/590/testReport
          Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/590/console
          Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-590/

          Messages:

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

          This message is automatically generated.

          ATTACHMENT ID: 12665748

          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/12665748/HIVE-7306.patch ERROR: -1 due to 8 failed/errored test(s), 6133 tests executed Failed tests: org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_windowing_windowspec org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_0_5 org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_3_0 org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_3_4 org.apache.hadoop.hive.ql.udaf.TestStreamingAvg.testDouble_7_2 org.apache.hive.hcatalog.pig.TestOrcHCatLoader.testReadDataPrimitiveTypes org.apache.hive.jdbc.miniHS2.TestHiveServer2.testConnection Test results: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/590/testReport Console output: http://ec2-174-129-184-35.compute-1.amazonaws.com/jenkins/job/PreCommit-HIVE-TRUNK-Build/590/console Test logs: http://ec2-174-129-184-35.compute-1.amazonaws.com/logs/PreCommit-HIVE-TRUNK-Build-590/ Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 8 tests failed This message is automatically generated. ATTACHMENT ID: 12665748
          Hide
          Ashutosh Chauhan added a comment -

          Test failures needs to be looked at.

          Show
          Ashutosh Chauhan added a comment - Test failures needs to be looked at.
          Ashutosh Chauhan made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Navis made changes -
          Assignee skrho [ rsk13th ]
          Navis made changes -
          Link This issue duplicates HIVE-7539 [ HIVE-7539 ]
          Navis made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Duplicate [ 3 ]
          Hide
          Navis added a comment -

          This is fixed by HIVE-7536. Feel free to open this again if it's not.

          Show
          Navis added a comment - This is fixed by HIVE-7536 . Feel free to open this again if it's not.
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          65d 16h 1m 1 skrho 01/Sep/14 11:04
          Patch Available Patch Available Open Open
          8h 13m 1 Ashutosh Chauhan 01/Sep/14 19:17
          Open Open Resolved Resolved
          12h 3m 1 Navis 02/Sep/14 07:21

            People

            • Assignee:
              skrho
              Reporter:
              Ted Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development