找到了一种奇怪但好用的处理方式:

目的:把time列中的秒数去掉

写法:

select 

time,
concat (to_date(time),' ',cast(hour(time) as string),':',cast(minute(time) as string))

from events 
limit 10

 

hive中时间格式的处理

 

不足之处 时间09:01 会变成9:1,看起来略奇怪

但是还是可用的!奇怪但好用

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
  • 2021-10-30
  • 2022-01-11
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-29
  • 2021-12-02
  • 2021-09-10
相关资源
相似解决方案