Repository navigation
Conversation
Updated comment for distinct_count to clarify that it provides an estimate of distinct values, which may vary.
|
cc @rdblue |
| * Estimated count of distinct values occurring. | ||
| * The estimate may be off in either direction by an underfined amount. |
There was a problem hiding this comment.
| * Estimated count of distinct values occurring. | |
| * The estimate may be off in either direction by an underfined amount. | |
| * count of distinct values occurring | |
| * The value does not account for differences in equality or interpretation of values |
There was a problem hiding this comment.
Thanks for the suggestion Daniel. What does this buy in practice? Is this definition well defined enough that it unlocks some use cases that are otherwise blocked?
There was a problem hiding this comment.
I prefer @danielcweeks suggested wording. @adriangb IMO what this buys us is a clear and targeted fix saying that distinct_count is essentially not useful for types where equality is vague or has multiple interpretations. But for types that can be unambiguously compared (integers, strings), distinct_count remains an exact count if set. The initially proposed wording ("Estimated count of distinct values occurring...") is a much broader statement that's redefining this field, which feels like a breaking change. I also agree with the conversation on the mailing list that if estimate count is what we want, we should add another field.
There was a problem hiding this comment.
I adopted the suggested wording in 3c7d0b7 since that seems to be the majority opinion.
I am however worried that moving forward with that is also a breaking change. Right now exactness is undefined or unknown. If we go with the wording in 3c7d0b7 any writer that used to write an estimate is now in violation of the spec.
It might be better to drop any attempt to define this field and instead make a new field and deprecate this one.
There was a problem hiding this comment.
IMO that would be a reasonable path forward
Hardwood's reader prunes on definition level histograms, including IS NULL / IS NOT NULL on group columns, but its writer emits none, so Hardwood cannot prune its own files on those predicates. The stage costs little since the counts are observed while levels are encoded, so it leads the open writer work ahead of S3 output and parallel encoding. Stage 29 is parked on apache/parquet-format#628, whose outcome decides whether an exact count is needed at all. The writer design doc pointed at an unrelated issue for the missing histograms.
Reviewers prefer a targeted note on equality semantics over redefining the field as an estimate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As per discussion in the sync call today and in https://lists.apache.org/thread.html/l8om71xjcv94x0z3hdvnbswk9ssyn2ks this clarifies the
distinct_countto be estimated/inexact.