huaxingao commented on PR #17669: URL: https://github.com/apache/iceberg/pull/17669#issuecomment-5611509678
> To put this change in context: the NPE fix here is about correctness of the code path, not about making boolean Z-ordering more useful. A boolean contributes a single meaningful bit to the interleaved key, and since that bit lands at the top of the Z-value it effectively splits the data into two halves and then Z-orders the remaining columns within each half. That is a valid layout, but it is closer to sort by flag than to real multi-dimensional clustering, and the same is true for any very low-cardinality column. > > Would it make sense to also log a warning when a Z-order or Hilbert column is boolean, or more generally has a type whose cardinality is known to be tiny? It wouldn't change behavior, but it would steer users away from a configuration that does less than they probably expect. > > Happy to add it in this PR or as a follow-up, whichever you prefer. No strong opinion, but I'd leave it out of this PR. The case that actually hurts is a low distinct-value count (e.g. a string with three values), which isn't visible from the type -- so a type-based warning would miss the common cases while firing on boolean columns that are a reasonable choice. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
