如何编写子查询并使用“In” Hive中的子句 [英] how to write subquery and use "In" Clause in Hive
问题描述
如何在Hive中使用In子句
我想在Hive中写这样的东西
从y选择x其中y.z in(从y选择不同的z)按x排序;
但我没有找到任何方式做它..
我试过在Hive 0.7中的子句它是抛出错误,我也尝试Find_in_Set ..
使用find_in_set(yz,子查询)。 。但是这项工作失败了。
我想在Hive上这样做。如果有人知道如何在Hive中执行此操作,请帮助我。
谢谢,问候,
Atul
根据 https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select :
Hive不支持WHERE子句中的IN,EXISTS或子查询。
你可能想看看:
https://issues.apache.org/jira/browse/HIVE-801
https://issues.apache.org/ jira / browse / HIVE-1799
How can I use In clause in Hive I want to write something like this in Hive select x from y where y.z in (select distinct z from y) order by x; But I am not finding any way of doing it.. I tried In clause in Hive 0.7 it was throwing error, Also I tried Find_in_Set .. using find_in_set(y.z,subquery).. but the job is getting failed.
I want to do this on Hive. Please help me if anybody knows how to do this in Hive..
Thanks & Regards, Atul
According to https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select:
"Hive does not support IN, EXISTS or subqueries in the WHERE clause."
You might want to look at: https://issues.apache.org/jira/browse/HIVE-801
https://issues.apache.org/jira/browse/HIVE-1799
这篇关于如何编写子查询并使用“In” Hive中的子句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!