Resource limit exceeded - Not enough disk space to execute this query

I have disabled the ApproximateCountDistinct and trying to get the distinct count but I am getting Resource limit exception

Error Message
Error: Resource limit exceeded
Not enough disk space to execute this query. Try raising druid.query.groupBy.maxOnDiskStorage.
org.apache.druid.query.ResourceLimitExceededException

Druid Details

Druid Version - 0.22.1
Master Node - 1(8 CPU and 32 GB Memory)
Data Node -1 (16 CPU and 122 GB Memory )
Query Node -1(8 CPU , 32 GB Memory and EBS - 800 GB)
Query - select count(distinct patient_hash) from druid.drug_analyzer_mx
Number of tables is one and storage is 25.2 GiB

Broker runtime Properties

druid.sql.planner.useApproximateCountDistinct=false
druid.processing.buffer.sizeBytes=500MiB
druid.processing.numMergeBuffers=6
druid.processing.numThreads=1
druid.processing.tmpDir=var/druid/processing

spillover

druid.query.groupBy.maxMergingDictionarySize=50000000
druid.query.groupBy.maxOnDiskStorage=100000000

Historical and Middle Manage Runtime properties

HTTP server threads

druid.server.http.numThreads=60

Processing threads and buffers

druid.processing.buffer.sizeBytes=500MiB
druid.processing.numMergeBuffers=4
druid.processing.numThreads=15
druid.processing.tmpDir=var/druid/processing

Segment storage

druid.segmentCache.locations=[{“path”:“var/druid/segment-cache”,“maxSize”:“600g”}]

Query cache

druid.historical.cache.useCache=true
druid.historical.cache.populateCache=true
druid.cache.type=caffeine
druid.cache.sizeInBytes=256MiB

spillover

druid.query.groupBy.maxMergingDictionarySize=50000000
druid.query.groupBy.maxOnDiskStorage=100000000

Welcome @sathishta! Are you querying on a large amount of data? An initial thought might be to increase druid.query.groupBy.maxOnDiskStorage.

1 Like

OOI do you have a time filter in your query? This will limit the number of segments that are scanned.

No we are trying to scan the full volume of data