時間戳轉為時間:
from_unixtime( unixtime,format),其中unixtime必須為整型(bigint),d若時間為秒時是10位,時間為毫秒時為13位。format是字符型(string),為所要轉換的日期
例:from_unixtime(cast(substr(dt,1,10)as bigint),"yyyy-MM-dd")as time
dt 原為string類型,使用substr函數取 dt 的前10位,再使用cast函數轉換成bigint類型,最后轉為日期,精准到日。