メインコンテンツまでスキップ

ミリ秒までの時間

TIME 値からミリ秒を抽出します。

構文

Python
from pyspark.databricks.sql import functions as dbf

dbf.time_to_millis(col=<col>)

パラメーター

パラメーター

Type

説明

col

pyspark.sql.Column または列名

変換する TIME 値。

Python
from pyspark.databricks.sql import functions as dbf
df = spark.sql("SELECT TIME'14:30:00.5' as time")
df.select(dbf.time_to_millis('time')).show()
Output
+--------------------+
|time_to_millis(time)|
+--------------------+
| 52200500|
+--------------------+