如何将“%Y%m%d%H%i%s”列拆分为两列:一列包含 %Y%m%d%,另一列包含配置单元中的 H%i%s?

How can I split a '%Y%m%d%H%i%s' column into two columns: one that contains %Y%m%d% and the that contains H%i%s in hive?

我有一列显示“%Y%m%d%H%i%s”(例如 20150125145900)如何将其转换为两列,一个 "ymd" 和另一个 "his" (例如 2015/01/25 和 14:59:00)?

select datetime[0] as,datetime[1] as小时from (select split(from_unixtime(unix_timestamp('20150125145900','yyyyMMddhhmmss'),'yyyy-MM-dd HH:mm:ss'),' ') as datetime)e

year          hour
2015-01-25  02:59:00

蜂巢

select  ts[0] as year
       ,ts[1] as hour

from   (select  split(from_unixtime(unix_timestamp('20150125145900','yyyyMMddHHmmss')
                    ,'yyyy-MM-dd HH:mm:ss'),' ') as ts
        ) t

+------------+----------+
|    year    |   hour   |
+------------+----------+
| 2015-01-25 | 14:59:00 |
+------------+----------+

Impala

select  split_part(ts,' ',1) as year
       ,split_part(ts,' ',2) as hour

from   (select  from_unixtime(unix_timestamp('20150125145900','yyyyMMddHHmmss')
                    ,'yyyy-MM-dd HH:mm:ss') as ts
        ) t
;

+------------+----------+
| year       | hour     |
+------------+----------+
| 2015-01-25 | 14:59:00 |
+------------+----------+