make_time
Create time from hour, minute and second fields. For invalid inputs it will throw an error.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.make_time(hour=<hour>, minute=<minute>, second=<second>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The hour to represent, from 0 to 23. |
|
| The minute to represent, from 0 to 59. |
|
| The second to represent, from 0 to 59.999999. |
Returns
pyspark.sql.Column: A column representing the created time.
Examples
Python
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()