Pyspark to_timestamp Wrong Time
Pyspark to_timestamp Wrong Time
Pyspark to_timestamp Wrong Time
- pyspark에서 timestamp로 저장된 정수값이, milisecond 단위의 정수 값일 수 있음
- 이 값을 그대로 to_timestamp 함수를 적용하는 경우, 잘못된 시간이 저장될 수 있음 (55000년이 됨)
- 이 때는 다음과 같이 값을 1000으로 나누면 됨
df = df.withColumn("ts", to_timestamp(col("ts") / 1000))