hypot
Calcule sqrt(a^2 + b^2) sans dépassement ou sous-dépassement intermédiaire. Prend en charge Spark Connect.
Pour la fonction Databricks SQL correspondante, consultez la fonctionhypot.
Syntaxe
Python
from pyspark.sql import functions as dbf
dbf.hypot(col1=<col1>, col2=<col2>)
parameter
parameter | Type | Description |
|---|---|---|
|
| une jambe. |
|
| Étape b. |
Renvoie
pyspark.sql.Column: longueur de l'hypoténuse.
Exemples
Python
from pyspark.sql import functions as dbf
spark.range(1).select(dbf.hypot(dbf.lit(1), dbf.lit(2))).show()
Output
+----------------+
| HYPOT(1, 2)|
+----------------+
|2.23606797749...|
+----------------+