@@ -46,6 +46,11 @@ namespace kll_constants {
4646 * and nearly optimal accuracy per retained item.
4747 * See <a href="https://arxiv.org/abs/1603.05346v2">Optimal Quantile Approximation in Streams</a>.
4848 *
49+ * Sketch that may retain string values.
50+ * For sketches containing strings, cross-language portability depends on
51+ * using compatible string encodings. This class does not by itself enforce
52+ * UTF-8 validity for all string inputs.
53+ *
4954 * <p>This is a stochastic streaming sketch that enables near real-time analysis of the
5055 * approximate distribution of items from a very large stream in a single pass, requiring only
5156 * that the items are comparable.
@@ -56,7 +61,7 @@ namespace kll_constants {
5661 * <p>As of May 2020, this implementation produces serialized sketches which are binary-compatible
5762 * with the equivalent Java implementation only when template parameter T = float
5863 * (32-bit single precision values).
59- *
64+ *
6065 * <p>Given an input stream of <i>N</i> items, the <i>natural rank</i> of any specific
6166 * item is defined as its index <i>(1 to N)</i> in inclusive mode
6267 * or <i>(0 to N-1)</i> in exclusive mode
@@ -225,13 +230,17 @@ class kll_sketch {
225230
226231 /* *
227232 * Updates this sketch with the given data item.
233+ * If cross-language portability is required, callers should ensure that
234+ * the input string uses a compatible encoding (valid UTF-8).
228235 * @param item from a stream of items
229236 */
230237 template <typename FwdT>
231238 void update (FwdT&& item);
232239
233240 /* *
234241 * Merges another sketch into this one.
242+ * If sketches contain strings, callers are responsible for ensuring that
243+ * both sketches were built using compatible string encodings.
235244 * @param other sketch to merge into this one
236245 */
237246 template <typename FwdSk>
0 commit comments