{"record":{"id":"876038f57f3b78e6","repo":"prestodb/presto","slug":"not-supported-876038","errorCode":"NOT_SUPPORTED","errorMessage":"%s","messagePattern":"%s","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java","lineNumber":109,"sourceCode":"                    valuePointer = values.getPositionCount();\n                    valueHashes.set(valuePointer, (int) valueHash);\n                    type.appendTo(block, position, values);\n                    buckets.set(bucketId, valuePointer);\n\n                    return valuePointer;\n                }\n                else if (type.equalTo(block, position, values, valuePointer)) {\n                    // value at position\n                    return valuePointer;\n                }\n                else {\n                    int probe = nextProbe(probeCount);\n                    bucketId = nextBucketId(originalBucketId, mask, probe);\n                    probeCount++;\n                }\n            }\n            catch (NotSupportedException e) {\n                throw new PrestoException(NOT_SUPPORTED, e.getMessage(), e);\n            }\n        }\n    }\n\n    private int getBucketId(long valueHash, int mask)\n    {\n        return (int) (valueHash & mask);\n    }\n\n    @VisibleForTesting\n    void rehash()\n    {\n        ++rehashCount;\n\n        long newBucketCountLong = bucketCount * 2L;\n\n        if (newBucketCountLong > Integer.MAX_VALUE) {\n            throw new PrestoException(GENERIC_INSUFFICIENT_RESOURCES, \"Size of hash table cannot exceed \" + Integer.MAX_VALUE + \" entries (\" + newBucketCountLong + \")\");","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/operator/aggregation/histogram/ValueStore.java#L91-L127","documentation":"ValueStore.addAndGetPosition wraps NotSupportedException (raised by the underlying OpenBigArray/HashTable probing code when an operation is unsupported) into a PrestoException with code NOT_SUPPORTED. This means the value store hit a capability its implementation does not provide, e.g. a store size or key configuration outside the supported range.","triggerScenarios":"Calling addAndGetPosition on ValueStore during histogram/min-max-n aggregation when the internal OpenBigHashTable raises NotSupportedException while probing/inserting a value hash into the bucket array.","commonSituations":"Aggregating extremely large cardinality values through histogram-type aggregations; configurations where the internal hash table cannot grow or allocate the needed capacity.","solutions":["Reduce input cardinality (pre-aggregate, bucket, or sample) so the value store stays within supported limits.","Check which inner operation throws NotSupportedException (inspect the cause chain) and align usage with its documented limits.","Use a different aggregation (e.g. approx_distinct, sketches) if exact per-value storage is required at this scale."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"-- Wrap the risky aggregation in a fallback\nSELECT COALESCE((SELECT histogram(val) FROM t WHERE <bounded>), MAP()) AS h;","preventionTips":["Keep per-aggregation value counts within documented limits.","Inspect exception cause chains to identify the unsupported inner operation.","Fall back to approximate aggregations for very high cardinality inputs."],"tags":["aggregation","not-supported","histogram","internal-limit"],"backgroundTag":"operation-not-supported","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}