티스토리 뷰

공부

[Spark] from_unixtime & to_timestamp

seunggabi 승가비 2020. 7. 24. 19:15
spark.sql("select timestamp(from_unixtime(1563853753,'yyyy-MM-dd HH:mm:ss')) as ts").show(false)
+-------------------+
|ts                 |
+-------------------+
|2019-07-22 22:49:13|
+-------------------+

spark.sql("select to_timestamp(1563853753) as ts").show(false)
+-------------------+
|ts                 |
+-------------------+
|2019-07-22 22:49:13|
+-------------------+

https://stackoverflow.com/questions/57156200/spark-dataframe-convert-bigint-to-timestamp

 

Spark Dataframe: Convert bigint to timestamp

I have a Dataframe with a bigint column. How to convert a bigint column to timestamp in scala spark

stackoverflow.com

https://sparkbyexamples.com/spark/spark-convert-string-to-timestamp-format/

 

Spark to_timestamp() - Convert String to Timestamp type — Spark by {Examples}

In this tutorial, you will learn how to convert a String column to Timestamp using Spark to_timestamp() function and the converted time would be in a

sparkbyexamples.com

 

댓글
댓글쓰기 폼