pyspark.sql.functions.
hypot
Computes sqrt(a^2 + b^2) without intermediate overflow or underflow.
sqrt(a^2 + b^2)
New in version 1.4.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
a leg.
b leg.
length of the hypotenuse.
Examples
>>> df = spark.range(1) >>> df.select(hypot(lit(1), lit(2))).first() Row(HYPOT(1, 2)=2.23606...)