配置单元:“where”条件包含子查询时执行错误

zwghvu4y  于 2021-06-25  发布在  Hive
关注(0)|答案(0)|浏览(220)

我有两张table。表1是大的,表2是小的。如果表1中的值 Table1.column1 与中的匹配 Table2.column1 . 表1和表2都有列, column1 . 这是我的密码。

select *
from Table1
where condition1
and condition2
and column1 in (select column1 from Table2)

条件1和条件2旨在限制要提取的表的大小。不确定这是否真的有效。然后我得到了 execution error, return code 1 . 我在月台上。
编辑
根据@yammanuarun的建议,我尝试了以下代码。

SELECT *
FROM
  (SELECT *
   FROM Table1
   WHERE condition1
     AND condition2) t1
INNER JOIN Table2 ON t1.column1 = t2.column1

然后,我得到了以下错误。

Error while processing statement: FAILED: Execution Error, return code 2 from 

org.apache.hadoop.hive.ql.exec.tez.TezTask. Application 

application_1580875150091_97539 failed 2 times due to AM Container for 

appattempt_1580875150091_97539_000002 exited with exitCode: 255 Failing this 

attempt.Diagnostics: [2020-02-07 14:35:53.944]Exception from container-launch.

Container id: container_e1237_1580875150091_97539_02_000001 Exit code: 255

Exception message: Launch container failed Shell output: main : command provided 1

 main : run as user is hive main : requested yarn user is hive Getting exit code

 file... Creating script paths... Writing pid file... Writing to tmp file /disk-
11/hadoop/yarn/local/nmPrivate/application_1580875150091_97539/container_e1237_1580875150091_97539_02_000001/container_e1237_1580875150091_97539_02_000001.pid.tmp

Writing to cgroup task files... Creating local dirs... Launching container... 

Getting exit code file... Creating script paths... [2020-02-07 14:35:53.967]Container exited with a non-zero exit code 255. Error file: prelaunch.err. Last 4096 bytes of prelaunch.err : Last 4096 bytes of stderr : 

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in 

thread "IPC Server idle connection scanner for port 26888" Halting due to Out Of 

Memory Error... Halting due to Out Of Memory Error... Halting due to Out Of Memory 
Error... 

Halting due to Out Of Memory Error... Halting due to Out Of Memory Error... 

Halting due to Out Of Memory Error... Halting due to Out Of Memory Error... 

Halting due to Out Of Memory Error... [2020-02-07 14:35:53.967]Container exited

 with a non-zero exit code 255. Error file: prelaunch.err. Last 4096 bytes of prelaunch.err : Last 4096 bytes of stderr : 

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in 

thread "IPC Server idle connection scanner for port 26888" Halting due to Out Of Memory Error... Halting due to Out Of Memory Error... 

Halting due to Out Of Memory Error... Halting due to Out Of Memory Error...

 Halting due to Out Of Memory Error... Halting due to Out Of Memory Error... 

Halting due to Out Of Memory Error... Halting due to Out Of Memory Error... 

For more detailed output, check the application tracking page: http://dcwipphm12002.edc.nam.gm.com:8088/cluster/app/application_1580875150091_97539 Then click on links to logs of each attempt. . Failing the application.

看起来是内存错误。有什么方法可以优化我的查询吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题