Uploaded image for project: 'Hivemall'
  1. Hivemall
  2. HIVEMALL-71

Handle null values in RescaleUDF.java

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.5.0
    • None

    Description

      Change:

          public FloatWritable evaluate(final float value, final float min,
      final float max) {
              return val(min_max_normalization(value, min, max));
          }
      

      to:

          @Nullable
          public FloatWritable evaluate(final Float value, final Float min,
      final Float max) throws HiveException {
              if(value == null) {
                  return null;
              }
              if(min == null) throw new HiveException("min should not be null");
              if(max == null) throw new HiveException("max should not be null");
      
              return val(min_max_normalization(value.floatValue(), min.floatValue(), max. floatValue()));
          }
      

      Attachments

        Issue Links

          Activity

            People

              myui Makoto Yui
              yumwang Yuming Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: