【发布时间】:2020-06-27 07:40:30
【问题描述】:
我有以下格式的数据集
2019-10-01 00:00:00 UTC,cart,5773203,1487580005134238553,,runail,2.62,463240011,26dd6e6e-4dac-4778-8d2c-92e149dab885
2019-10-01 00:00:03 UTC,cart,5773353,1487580005134238553,,runail,2.62,463240011,26dd6e6e-4dac-4778-8d2c-92e149dab885
2019-10-01 00:00:07 UTC,cart,5881589,2151191071051219817,,lovely,13.48,429681830,49e8d843-adf3-428b-a2c3-fe8bc6a307c9
2019-10-01 00:00:07 UTC,cart,5723490,1487580005134238553,,runail,2.62,463240011,26dd6e6e-4dac-4778-8d2c-92e149dab885
我已经创建了一个表来将数据加载到表中。
create table if not exists product_data (event_time string,event_type string,product_id string,category_id string,category_code string,brand string,price float,user_id bigint,user_session string) row format delimited fields terminated by ',' lines terminated by '\n' tblproperties("skip.header.line.count"="1");
是否可以将 event_time 字段直接加载为时间戳值? 非常感谢 Hive 的新手和任何帮助
【问题讨论】:
-
从 Hive 1.2.0 开始,可以提供额外的 SerDe 属性 "timestamp.formats" stackoverflow.com/a/58501775/2700344