From 6585a24853421fe0de7cbe4d9cc116d8adb1e695 Mon Sep 17 00:00:00 2001 From: yangjie01 Date: Tue, 30 Jun 2026 17:19:56 +0800 Subject: [PATCH] [MINOR][CORE] Fix swapped depth/width formulas in CountMinSketch class doc The class doc had `d` and `w` swapped relative to the implementation, which sets `width = ceil(2 / eps)` and `depth = ceil(-log(1 - confidence) / log(2))`. --- .../java/org/apache/spark/util/sketch/CountMinSketch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java index 06a248c9a27c2..cc958f947b4d2 100644 --- a/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java +++ b/common/sketch/src/main/java/org/apache/spark/util/sketch/CountMinSketch.java @@ -45,8 +45,8 @@ * Under the cover, a {@link CountMinSketch} is essentially a two-dimensional {@code long} array * with depth {@code d} and width {@code w}, where * * * This implementation is largely based on the {@code CountMinSketch} class from stream-lib.