我想在Hive中執行CRUD操作,並且能夠成功運行插入查詢,但是當我試圖運行更新並刪除下面的異常時。在蜂巢中的CRUD操作
FAILED:SemanticException [錯誤10294]:嘗試使用不支持這些操作的事務管理器進行更新或刪除。查詢的
列表我跑
CREATE TABLE students (name VARCHAR(64), age INT, gpa DECIMAL(3, 2))
CLUSTERED BY (age) INTO 2 BUCKETS STORED AS ORC;
INSERT INTO TABLE students
VALUES ('fred flintstone', 35, 1.28), ('barney rubble', 32, 2.32);
CREATE TABLE pageviews (userid VARCHAR(64), link STRING, came_from STRING)
PARTITIONED BY (datestamp STRING) CLUSTERED BY (userid) INTO 256 BUCKETS STORED AS ORC;
INSERT INTO TABLE pageviews PARTITION (datestamp = '2014-09-23')
VALUES ('jsmith', 'mail.com', 'sports.com'), ('jdoe', 'mail.com', null);
INSERT INTO TABLE pageviews PARTITION (datestamp)
VALUES ('tjohnson', 'sports.com', 'finance.com', '2014-09-23'), ('tlee', 'finance.com', null, '2014-09-21');
來源:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Delete
更新和刪除查詢我試圖運行
update students1 set age = 36 where name ='barney rubble';
update students1 set name = 'barney rubble1' where age =36;
delete from students1 where age=32;
蜂巢版本:2.1(最新)
注意:我知道Hive不是用於更新和刪除命令(在BigData集合上)仍然試圖做的,以獲得對Hive CRUD操作的瞭解。
有人可以指出/指引我要去哪裏更新/刪除查詢錯誤。
你是否設置了表格屬性「transactional = true」? https://cwiki.apache.org/confluence/display/Hive/Hive+Transactions#HiveTransactions-TableProperties – yoga
我試圖通過設置transcational = true來創建一個新表。此時插入也不起作用CREATE TABLE students2(name VARCHAR(64),age INT,gpa DECIMAL(3,2)) CLUSTERED BY(age)INTO 2作爲ORC TBLPROPERTIES存儲的桶(「transactional」=「true」) ; INSERT INTO TABLE students2 VALUES('fred flintstone',35,1.28),('barney碎石',32,2.32); FAILED:SemanticException [錯誤10265]:該命令不允許在具有非ACID事務管理器的ACID表glx.students2上。失敗的命令:INSERT INTO TABLE students2值(...) – Ram