Yuming Wang created HIVEMALL-71:
-----------------------------------

             Summary: Handle null values in RescaleUDF.java
                 Key: HIVEMALL-71
                 URL: https://issues.apache.org/jira/browse/HIVEMALL-71
             Project: Hivemall
          Issue Type: Improvement
            Reporter: Yuming Wang


Change:
{code:java}
    public FloatWritable evaluate(final float value, final float min,
final float max) {
        return val(min_max_normalization(value, min, max));
    }
{code}
to:
{code:java}
    @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()));
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to