How do we record the exact microsecond timestamp when records are processed by Spark?
current_timestamp() returns the current date and time as a TimestampType Column.
Micro-batch stream auditing, SLA latency measurement, and event provenance tracking.
from pyspark.sql.functions import current_timestamp
df = df.withColumn("processed_at", current_timestamp())Practice typing production-grade PySpark code for Injecting Current Timestamp with current_timestamp().