大家好,我是 Hive 新手,我想将当前时间戳与一行数据一起插入到我的表中。
这是我的团队表的示例:
team_id int
fname string
lname string
time timestamp
我看过其他一些例子,How to insert timestamp into a Hive table? , How can I add a timestamp column in hive似乎无法让它发挥作用。 这就是我正在尝试的:
insert into team values('101','jim','joe',from_unixtime(unix_timestamp()));
我得到的错误是:
FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values
如果有人能帮忙,那就太好了,非常感谢 frostie
最佳答案
可以通过 current_timestamp()
实现,但只能通过 select 子句。甚至不需要在 select 语句中使用 from
子句。
insert into team select '101','jim','joe',current_timestamp();
或者如果您的配置单元版本不支持在选择语句中保留 from
insert into team select '101','jim','joe',current_timestamp() from team limit 1;
关于hadoop - 将时间戳插入 Hive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37863194/