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.
Create time from hour, minute and second fields. For invalid inputs it will throw an error.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.make_time(hour=<hour>, minute=<minute>, second=<second>)
Parameters
| Parameter | Type | Description |
|---|---|---|
hour |
pyspark.sql.Column or str |
The hour to represent, from 0 to 23. |
minute |
pyspark.sql.Column or str |
The minute to represent, from 0 to 59. |
second |
pyspark.sql.Column or str |
The second to represent, from 0 to 59.999999. |
Returns
pyspark.sql.Column: A column representing the created time.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(6, 30, 45.887)], ["hour", "minute", "second"])
df.select(dbf.make_time("hour", "minute", "second").alias("time")).show()