Repository navigation
Stabilize hash codes used by the planner - #4263
Merged
Merged
Conversation
robert-brunel
force-pushed
the
hash-stability
branch
from
June 8, 2026 10:14
c3b73cf to
7047f46
Compare
This change fixes some unstable hash codes that can affect the planner; in particular, uses of `Enum.hashCode()` and `byte[].hashCode()`. Those inherit the identity-based `hashCode()` method from `Object` and can therefore return different values on every JVM run for the same logical content. To stabilize them, we compute the hashes from `enum.name()` or `PlanHashable.objectPlanHash()` instead. * The hashes of `ListComparison`, `ParameterComparisonBase`, and `LitervalValue.hashCodeWithoutChildren()` flow into `AbstractValue.semanticHashCode()`, which is used as the tie-breaker in `RewritingCostModel`. * The hashes of `Ordering.Binding` and `PredicateMultiMap.MappingKey` can affect the bucket layout for maps keyed on `Binding` or `MappingKey`, and thus the planning iteration order.
robert-brunel
force-pushed
the
hash-stability
branch
from
June 12, 2026 12:55
7047f46 to
32b73a7
Compare
normen662
approved these changes
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change fixes some unstable hash codes that can affect the planner; in particular, uses of
Enum.hashCode()andbyte[].hashCode(). Those inherit the identity-basedhashCode()method fromObjectand can therefore return different values on every JVM run for the same logical content. To stabilize them, we compute the hashes fromenum.name()orPlanHashable.objectPlanHash()instead.The hashes of
ListComparison,ParameterComparisonBase, andLitervalValue.hashCodeWithoutChildren()flow intoAbstractValue.semanticHashCode(), which is used as the tie-breaker inRewritingCostModel.The hashes of
Ordering.BindingandPredicateMultiMap.MappingKeycan affect the bucket layout for maps keyed onBindingorMappingKey, and thus the planning iteration order.