Apache Hive - 单个插入日期值

Ner*_*rve 3 hadoop hiveql apache-hive

我正在尝试使用 Hive 将日期插入到日期列中。到目前为止,这是我尝试过的

INSERT INTO table1 (EmpNo, DOB)
VALUES ('Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date));
Run Code Online (Sandbox Code Playgroud)

INSERT INTO table table1 values('Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date));
Run Code Online (Sandbox Code Playgroud)

INSERT INTO table1 SELECT 
'Clerk#0008000', cast(substring(from_unixtime(unix_timestamp(cast('2016-01-01' as string), 'yyyy-MM-dd')),1,10) as date);
Run Code Online (Sandbox Code Playgroud)

但我仍然得到

FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values
Run Code Online (Sandbox Code Playgroud)

或者

FAILED: ParseException line 2:186 Failed to recognize predicate '<EOF>'. Failed rule: 'regularBody' in statement
Run Code Online (Sandbox Code Playgroud)

Hive ACID 已在基于 ORC 的表上启用,并且没有日期的简单插入正在工作。

我想我错过了一些非常简单的东西。但不能把我的手指放在上面。

Ner*_*rve 5

好的。我找到了。我现在觉得自己像个傻瓜。

就这么简单

INSERT INTO table1 values ('Clerk#0008000', '2016-01-01');
Run Code Online (Sandbox Code Playgroud)