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 the ceiling of the given value. Supports Spark Connect.
For the corresponding Databricks SQL function, see ceiling function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.ceiling(col=<col>, scale=<scale>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or column name |
The target column or column name to compute the ceiling on. |
scale |
pyspark.sql.Column or int |
An optional parameter to control the rounding behavior. |
Returns
pyspark.sql.Column: A column for the computed results.
Examples
from pyspark.databricks.sql import functions as dbf
spark.range(1).select(dbf.ceiling(dbf.lit(-0.1))).show()
+-------------+
|ceiling(-0.1)|
+-------------+
| 0|
+-------------+
from pyspark.databricks.sql import functions as dbf
spark.range(1).select(dbf.ceiling(dbf.lit(-0.1), 1)).show()
+----------------+
|ceiling(-0.1, 1)|
+----------------+
| -0.1|
+----------------+