l2_norm


l2_norm(double x) – Return a L2 norm of the given input x.

WITH input as (
select generate_series(1,3) as v
)
select l2_norm(v) as l2norm
from input;
3.7416573867739413 = sqrt(1^2+2^2+3^2))

Platforms: WhereOS, Spark, Hive
Class: hivemall.tools.math.L2NormUDAF

More functions can be added to WhereOS via Python or R bindings or as Java & Scala UDF (user-defined function), UDAF (user-defined aggregation function) and UDTF (user-defined table generating function) extensions. Custom libraries can be added on via Settings-page or installed from WhereOS Store.

Leave a Reply