Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Computes hyperbolic sine of the input column. Supports Spark Connect.
For the corresponding Databricks SQL function, see sinh function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.sinh(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
hyperbolic angle. |
Returns
pyspark.sql.Column: hyperbolic sine of the given value, as if computed by java.lang.Math.sinh()
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(-1,), (0,), (1,)], ["value"])
df.select("*", dbf.sinh(df.value)).show()
+-----+-------------------+
|value| SINH(value)|
+-----+-------------------+
| -1|-1.1752011936438...|
| 0| 0.0|
| 1| 1.1752011936438...|
+-----+-------------------+
from pyspark.databricks.sql import functions as dbf
spark.sql(
"SELECT * FROM VALUES (FLOAT('NAN')), (NULL) AS TAB(value)"
).select("*", dbf.sinh("value")).show()
+-----+-----------+
|value|SINH(value)|
+-----+-----------+
| NaN| NaN|
| NULL| NULL|
+-----+-----------+