hadoop aws不会在屏幕上显示输出

7jmck4yq  于 2021-06-01  发布在  Hadoop
关注(0)|答案(1)|浏览(325)

当我在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
zsohkypk

zsohkypk1#

它告诉您没有与where语句匹配的数据行。
您应该调试这些查询,以找出没有得到预期结果的原因。
例如,表中的数据可能不同。尝试使用以下方式查看数据:

select * from records limit 10

然后进一步深入:

select * from records where temperature != 9999 limit 10

检查给定的值 quality 以及它们是否符合你的where语句。
与其问为什么它不起作用,不如证明数据在那里,并表明它应该起作用。

相关问题