报错信息
今天用Druid
(版本0.18.0) 做两个DataSource
的join
时报错:
Resource limit exceeded /
Subquery generated results beyond maximum[100000] /
org.apache.druid.query.ResourceLimitExceededException
报错意思就是子查询结果超过了最大限定100000行
查阅资料后发现这个参数由druid.server.http.maxSubqueryRows
来控制。
官网上有这样一句话:
https://druid.apache.org/docs/latest/configuration/index.html#server-configuration:
Previous versions of Druid had properties named druid.sql.planner.maxQueryCount and druid.sql.planner.maxSemiJoinRowsInMemory. These properties are no longer available. Since Druid 0.18.0, you can use
druid.server.http.maxSubqueryRows
to control the maximum number of rows permitted across all subqueries.
关于这个配置的解释:
Property | Description | Default |
---|---|---|
druid.server.http.maxSubqueryRows | Maximum number of rows from subqueries per query. These rows are stored in memory. | 100000 |
解决方法
修改 conf/druid/xxx/xxx/broker 下的 runtime.properties
(xxx是根据启动的集群模式找到对应的目录)
添加:
druid.server.http.maxSubqueryRows=1000000
添加这个参数的时候,要注意不要超过集群能提供的最大资源。