Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: introduce new method accurate_columns_ranges to Table #16247

Merged
merged 3 commits into from
Aug 16, 2024

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Aug 14, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

Introduce a new method accurate_columns_ranges to the Table trait, which returns the "accurate" ranges of the given columns.

The bounds of the column ranges are derived from the segment information of the given table, making them tight. However, for string-type columns, the bounds may have been truncated, which is indicated by the may_be_truncated field in the Bound struct.

accurate_columns_ranges is intended to be used later in the optimization of queries like SELECT MIN/MAX(col) FROM t.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Aug 14, 2024
Introduce a new method `accurate_columns_ranges` to the `Table` trait,
which returns the "accurate" ranges of the given columns.

The bounds of the column ranges are derived from the segment information
of the given table, making them tight. However, for string-type columns,
the bounds may have been truncated, which is indicated by the
`may_be_truncated` field in the `Bound` struct.
@dantengsky dantengsky force-pushed the feat-accurate_columns_ranges branch from 96cb50a to baaa006 Compare August 14, 2024 12:57
@dantengsky dantengsky marked this pull request as ready for review August 16, 2024 03:42
@dantengsky dantengsky requested a review from sundy-li August 16, 2024 03:42
@sundy-li sundy-li added this pull request to the merge queue Aug 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 16, 2024
@dantengsky dantengsky added this pull request to the merge queue Aug 16, 2024
Merged via the queue into databendlabs:main with commit 01e29d5 Aug 16, 2024
73 checks passed
@dantengsky dantengsky deleted the feat-accurate_columns_ranges branch August 16, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants