pyspark.sql.functions.make_time#
- pyspark.sql.functions.make_time(hour, minute, second)[source]#
Create time from hour, minute and second fields. For invalid inputs it will throw an error.
New in version 4.1.0.
- Parameters
- Returns
Column
A column representing the created time.
Examples
>>> from pyspark.sql import functions as sf >>> df = spark.createDataFrame([(6, 30, 45.887)], ["hour", "minute", "second"]) >>> df.select(sf.make_time("hour", "minute", "second").alias("time")).show() +------------+ | time| +------------+ |06:30:45.887| +------------+