【发布时间】:2020-09-27 06:49:38
【问题描述】:
我运行这个查询并且它有效:
insert into default.dw_partitioned_table
partition (partition_islemtarih_string)
select *, cast(replace(strleft(recorddate,10),'-','')as int) as partition_islemtarih_string
from default.dw_hive_table
where recorddate <to_timestamp('2019-05-01 00:00:00', 'yyyy-MM-dd HH:mm:ss')
and recorddate>=to_timestamp('2019-01-01 00:00:00', 'yyyy-MM-dd HH:mm:ss');
但是当同时运行 2 个不同的查询时,会出现如下错误:
Memory limit exceeded: Failed to allocate row batch EXCHANGE_NODE (id=1) could not allocate 8.00 KB without exceeding limit.
Error occurred on backend xxx.xxyy.intra:22000
Memory left in process limit: 6.54 GB Query(sss:vvv): Reservation=26.20 GB
ReservationLimit=36.72 GB OtherMemory=37.43 MB Total=26.24 GB Peak=26.24 GB
Fragment sss:vvv: Reservation=25.94 GB OtherMemory=6.60 MB
Total=25.95 GB Peak=25.95 GB SORT_NODE (id=2): Reservation=25.94 GB
OtherMemory=40.00 KB Total=25.94 GB Peak=25.94 GB
EXCHANGE_NODE (id=1): Reservation=6.55 MB
------------------------------------------------------------------------
我该如何解决这个问题?
【问题讨论】:
-
这是一个非常常见的 impala 错误。这意味着您的 sql 正在消耗大量内存来处理数据。您可以尝试制动成零件,也可以要求管理员为您的用户分配更多内存。另请检查此语句
cast(replace(strleft(recorddate,10),'-','')as int)是否生成整数。请将其更改为cast(from_timestamp(recorddate,'yyyyMM') as int)以确保其有效。 -
谢谢回答,我会试试的