ApacheHive0.14上的sql连接更新和删除查询

7gyucuyw  于 2021-05-30  发布在  Hadoop
关注(0)|答案(1)|浏览(379)

我正在搜索对update/delete连接的支持hive0.14支持事务查询,比如teradata15.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)
xlpyo6sf

xlpyo6sf1#

你必须参考 cart 通过一种 join ```
DELETE album
FROM album INNER JOIN cart ON (album.id = cart.albumid)

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

相关问题