加入Apache Hive 0.14更新和删除查询

时间:2014-12-10 13:45:21

标签: sql hadoop hive antlr3 hiveql

我正在寻找对更新/删除Hive 0.14的连接的支持,它支持事务性查询,例如teradata 15.00支持sql查询,如

DELETE FROM employee
WHERE employee.deptno = department.deptno
AND department.location = 'NYC';

DELETE employee
FROM department AS d, employee
WHERE employee.dept_no = d.dept_no
AND salary_pool < 50000;

UPDATE e
FROM employee AS e, department AS d
SET salary = salary * 1.05
WHERE e.emp_no = d.emp_no;

在这里,当我在hive中引用第二个表时,我得到了

delete from album where album.id = cart.albumid;

获取错误:

FAILED: SemanticException [Error 10004]: Line 1:35 Invalid table alias or column reference 'cart': (possible column names are: id, name)

1 个答案:

答案 0 :(得分:0)

您必须通过一种cart

引用join
DELETE album 
FROM album INNER JOIN cart ON (album.id = cart.albumid)

在您提供的示例中,表格通过,

加入