Apache Hive - 单次插入日期值
Apache Hive - Single Insert Date Value
我正在尝试使用 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));
和
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));
和
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);
但我仍然得到
FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values
或
FAILED: ParseException line 2:186 Failed to recognize predicate '<EOF>'. Failed rule: 'regularBody' in statement
Hive ACID 已在基于 table 的 ORC 上启用,没有日期的简单插入工作正常。
我想我错过了一些非常简单的东西。但不能把我的手指放在上面。
好的。我找到了。我现在觉得自己像个傻瓜。
就这么简单
INSERT INTO table1 values ('Clerk#0008000', '2016-01-01');
我正在尝试使用 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));
和
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));
和
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);
但我仍然得到
FAILED: SemanticException [Error 10293]: Unable to create temp file for insert values Expression of type TOK_FUNCTION not supported in insert/values
或
FAILED: ParseException line 2:186 Failed to recognize predicate '<EOF>'. Failed rule: 'regularBody' in statement
Hive ACID 已在基于 table 的 ORC 上启用,没有日期的简单插入工作正常。
我想我错过了一些非常简单的东西。但不能把我的手指放在上面。
好的。我找到了。我现在觉得自己像个傻瓜。
就这么简单
INSERT INTO table1 values ('Clerk#0008000', '2016-01-01');