当我在aws中运行下面的代码时,
SELECT year, MAX(temperature)
FROM records
WHERE temperature != 9999
AND (quality = 0 OR quality = 1 OR quality = 4 OR quality = 5 OR quality = 9)
GROUP BY year;
我从aws emr得到“ok”,如第一张图所示…
…但我看不到预期的结果/输出
1949 111
1950 22
就像第二张图片中的一样:
我尝试的代码:
hive>
> SELECT year, MAX(temperature)
> FROM records
> WHERE temperature != 9999
> AND (quality = 0 OR quality = 1 OR quality = 4 OR quality = 5 OR quality = 9)
> GROUP BY year;
Query ID = hadoop_20180302235859_3409fe28-465e-4857-9c10-243bcaafe819
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1520032089791_0005)
----------------------------------------------------------------------------------------------
VERTICES MODE STATUS TOTAL COMPLETED RUNNING PENDING FAILED KILLED
----------------------------------------------------------------------------------------------
Map 1 .......... container SUCCEEDED 1 1 0 0 0 0
Reducer 2 ...... container SUCCEEDED 1 1 0 0 0 0
----------------------------------------------------------------------------------------------
VERTICES: 02/02 [==========================>>] 100% ELAPSED TIME: 5.03 s
----------------------------------------------------------------------------------------------
OK
Time taken: 6.488 seconds
1条答案
按热度按时间zsohkypk1#
它告诉您没有与where语句匹配的数据行。
您应该调试这些查询,以找出没有得到预期结果的原因。
例如,表中的数据可能不同。尝试使用以下方式查看数据:
然后进一步深入:
检查给定的值
quality
以及它们是否符合你的where语句。与其问为什么它不起作用,不如证明数据在那里,并表明它应该起作用。