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.
Creates timestamp from the number of microseconds since UTC epoch.
For the corresponding Databricks SQL function, see timestamp_micros function.
Syntax
from pyspark.sql import functions as dbf
dbf.timestamp_micros(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
unix time values. |
Returns
pyspark.sql.Column: converted timestamp value.
Examples
spark.conf.set("spark.sql.session.timeZone", "UTC")
from pyspark.sql import functions as dbf
df = spark.createDataFrame([(1230219000,), (1280219000,)], ['micros'])
df.select('*', dbf.timestamp_micros('micros')).show(truncate=False)
spark.conf.unset("spark.sql.session.timeZone")