Skip to content

Conversation

Tpt
Copy link
Contributor

@Tpt Tpt commented Oct 5, 2025

Use saturating operations, if the operation saturates, Exact is changed to Inexact

Note this is not consistent with Precision::<ScalarValue> that wraps, happy to change behavior to wrapping here too if considered more relevant (but for cardinality estimations, saturation seems to make more sense to me).

Which issue does this PR close?

Rationale for this change

Avoid panics on large number of joins in debug mode that explode estimated cardinalities.

@github-actions github-actions bot added the common Related to common crate label Oct 5, 2025
Use saturating operations

Note this is not consistent with Precision::<ScalarValue> that wraps, happy to change behavior to wrapping here too
@Tpt Tpt force-pushed the tpt/precision-overflow branch from b51ddac to 7fba1a3 Compare October 5, 2025 17:01
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me -- thank you @Tpt

@alamb alamb added this pull request to the merge queue Oct 7, 2025
Merged via the queue into apache:main with commit ed5f8e7 Oct 7, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Precision::multiply overflow

2 participants