Apache Drill: How to resolve - RESOURCE ERROR: One or more nodes ran out of memory while executing the query?

Apache Drill: How to resolve - RESOURCE ERROR: One or more nodes ran out of memory while executing the query?

我在 windows 系统上使用 Apache Drill 版本 1.14 并且 运行ning Drill 使用命令:

sqlline.bat -u "jdbc:drill:zk=local"

我正尝试在两个 compressedarchived CSV 文件上 execute join query

查询:

SELECT  *  FROM dfs.`C:\Users\admin\Desktop\DRILL_FILES\csvFileParquet\TBL_MOREDATA-20180924181406.tar.gz` AS Table0 INNER JOIN dfs.`C:\Users\admin\Desktop\DRILL_FILES\csvFileParquet\TBL_MOREDATA1-20180924181406.tar.gz` AS Table1  ON  Table0.columns[0]=Table1.columns[0]

但是内存不足,发生错误:

org.apache.drill.common.exceptions.UserRemoteException: RESOURCE ERROR: One or more nodes ran out of memory while executing the query. Unable to allocate buffer of size 131072 (rounded from 86104) due to memory limit (630194176). Current allocation: 630108434 Fragment 0:0 [Error Id: 585c0644-5fd5-446e-b9b3-d48e0771eb2a on DESKTOP-SM3E3KM:31010]

为了解决这个问题,我尝试更新 config\drill-env.sh 文件,但问题仍然存在,更新脚本文件似乎没有反映出这些变化,因为我试图将 DIRECT MEMORY 增加到系统内存 (RAM),每次 drill 都会和平启动。甚至没有抱怨你已经超出了内存,因此,看起来这些变化没有反映出来。

export DRILLBIT_MAX_PROC_MEM=12G
export DRILL_HEAP=2G
export DRILL_MAX_DIRECT_MEMORY=10G

而我系统的主内存只有 8 GB。

请帮我解决内存不足的错误。为了按照故障排除说明进行操作,我什至有 运行 以下查询,但问题仍然存在。

alter session set `planner.enable_hashagg` = false;  
alter session set `planner.enable_hashjoin` = false;
alter session set planner.width.max_per_node=3; 
alter system set planner.width.max_per_query = 100;

基于doc钻取只支持压缩文件读取,不支持压缩文件。您可以创建一个 Jira 票证来实现它。 读取归档压缩 CSV 文件时,第一行钻取 returns 不可读数据。所以你可以使用 offset 1.

Drill 利用直接内存来存储批次。所以 JOIN 操作需要更多的直接内存。 减少并行度可以减少内存消耗:
planner.width.max_per_node(和可选的 planner.width.max_per_query 设置为 1。
禁用 HashJoin 运算符用法:planner.enable_hashjoin
Drill documentation.中查看更多内容
同时考虑启用 planner.memory.enable_memory_estimation 选项。

要验证您在 drill-env.sh 中的配置是否已应用,运行 以下查询:

select * from sys.memory;