hivemall-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Makoto Yui (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (HIVEMALL-71) Handle null values in RescaleUDF.java
Date Thu, 16 Feb 2017 06:28:41 GMT

     [ https://issues.apache.org/jira/browse/HIVEMALL-71?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Makoto Yui closed HIVEMALL-71.
------------------------------
    Resolution: Fixed
      Assignee: Makoto Yui

> 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
>            Assignee: Makoto Yui
>
> 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)

Mime
View raw message