Teilen über


timestamp_micros

Erstellt zeitstempel aus der Anzahl der Mikrosekunden seit UTC-Epoche.

Die entsprechende Databricks SQL-Funktion finden Sie unter timestamp_micros Funktion.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.timestamp_micros(col=<col>)

Die Parameter

Parameter Typ Description
col pyspark.sql.Column oder str Unix-Zeitwerte.

Rückkehr

pyspark.sql.Column: Konvertierter Zeitstempelwert.

Examples

spark.conf.set("spark.sql.session.timeZone", "UTC")
from pyspark.databricks.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")