将时间戳插入蜂巢中



嗨,我是新来的Hive,我想将当前时间戳与一排数据一起插入我的表格。

这是我的团队表:

的示例
team_id int
fname   string
lname   string
time    timestamp

我查看了其他一些示例,如何将时间戳插入蜂巢桌?,如何在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子句来实现。甚至不需要from子句在Select Statment中。

insert into team select '101','jim','joe',current_timestamp();

,或者如果您的Hive版本不支持在Select Statment中离开from

insert into team select '101','jim','joe',current_timestamp() from team limit 1;

如果您还没有至少一行的表格,则可以完成所需的结果。

insert into team select '101','jim','joe',current_timestamp() from (select '123') x;

最新更新