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

Handle null values in RescaleUDF.java

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.5.0
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: