Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-12826

Vectorization: fix VectorUDAF* suspect isNull checks

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0, 2.0.0, 2.1.0
    • 2.0.0
    • Vectorization
    • None
    • Hide
      commit 36e855084da833915dfe6c34f74e19352b64fde9

          Vectorization: fix VectorUDAF* suspect isNull checks (Gopal V, reviewed by Matt McCline)
          
          Signed-off-by: Gopal V <gopalv@apache.org>
      Show
      commit 36e855084da833915dfe6c34f74e19352b64fde9     Vectorization: fix VectorUDAF* suspect isNull checks (Gopal V, reviewed by Matt McCline)          Signed-off-by: Gopal V < gopalv@apache.org >

    Description

      for isRepeating=true, checking isNull[selected[i]] might return incorrect results (without a heavy array fill of isNull).

      VectorUDAFSum/Min/Max/Avg and SumDecimal impls need to be reviewed for this pattern.

          private void iterateHasNullsRepeatingSelectionWithAggregationSelection(
            VectorAggregationBufferRow[] aggregationBufferSets,
            int aggregateIndex,
            <ValueType> value,
            int batchSize,
            int[] selection,
            boolean[] isNull) {
            
            for (int i=0; i < batchSize; ++i) {
              if (!isNull[selection[i]]) {
                Aggregation myagg = getCurrentAggregationBuffer(
                  aggregationBufferSets, 
                  aggregateIndex,
                  i);
                myagg.sumValue(value);
              }
            }
          }
      

      Attachments

        1. HIVE-12826.1.patch
          12 kB
          Gopal Vijayaraghavan

        Issue Links

          Activity

            People

              gopalv Gopal Vijayaraghavan
              gopalv Gopal Vijayaraghavan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: