在配置单元中是否支持AND子句

时间:2014-05-29 06:11:56

标签: sql hadoop hive

我正在尝试在HIVE中执行以下查询。

select plc 
 from processed p 
WHERE p.day=26 
  AND p.time_id = 41;

但是,我没有结果。但是,在执行以下查询时,我得到有效的结果

select plc from processed p WHERE p.day=26 

我已检查过我的表格,其中包含与day = 26 and time_id = 41对应的内容。 Hive不支持多个AND子句吗?

1 个答案:

答案 0 :(得分:0)

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Select表明Hive确实支持AND子句。特别是,它们的第一个WHERE子句示例包括AND:

WHERE Clause

The WHERE condition is a boolean expression. For example, the following query returns only those sales records which have an amount greater than 10 from the US region. Hive supports a number of operators and UDFs in the WHERE clause:
SELECT * FROM sales WHERE amount > 10 AND region = "US"