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