Skip to content

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Apr 9, 2025

Which issue does this PR close?

Rationale for this change

We are trying to improve statistics handling (so we can use it more). It turns out that the code to aggregate statistics in ListingTable was repliated with code already present in Precision

What changes are included in this PR?

  1. Remove redundant code
  2. Deprecate one public method

Are these changes tested?

By existing CI

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate datasource Changes to the datasource crate labels Apr 9, 2025
@alamb alamb force-pushed the alamb/remove_replication branch from 0f10878 to d818b17 Compare April 9, 2025 16:26

/// If the given value is numerically greater than the original maximum value,
/// return the new maximum value with appropriate exactness information.
fn set_max_if_greater(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this code is the same as Precision::min and Precision::max, so we can avoid the duplication

@alamb alamb force-pushed the alamb/remove_replication branch from ef8b5ea to 7ac2c7a Compare April 9, 2025 16:46
@alamb alamb changed the title Remove redundant code in favor of min/max/add Remove redundant Precision combination code in favor of Precision::min/max/add Apr 9, 2025
@alamb alamb marked this pull request as ready for review April 9, 2025 16:50
@alamb alamb requested a review from xudong963 April 9, 2025 17:22
Copy link
Member

@xudong963 xudong963 left a comment

Choose a reason for hiding this comment

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

Thanks @alamb

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

👍🏻

@xudong963 xudong963 merged commit 43ee992 into apache:main Apr 10, 2025
28 checks passed
@alamb alamb deleted the alamb/remove_replication branch April 10, 2025 17:51
@alamb
Copy link
Contributor Author

alamb commented Apr 10, 2025

Thanks @xudong963 and @jayzhan211

nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate datasource Changes to the datasource crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unify Precision::max and set_max_if_greater methods

3 participants