You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow index pruning and filter pushdown when an integral column is compared with a float literal in a predicate - #98516
Allow index pruning and filter pushdown when an integral column is compared with a float literal; for example, predicates like WHERE x < 10.5 can now use the primary key for pruning, and filters such as prime < 1e9 or number < 1e5 are now pushed down for the primes() and numbers() table functions instead of causing unbounded execution. Closes#85167.
Documentation entry for user-facing changes
Documentation is written (mandatory for new features)
@zlareb1primes() and numbers() are unbounded generators. Both use KeyCondition's filter (WHERE) analysis to understand if they can bound prime/number generation. Previously, KeyCondition was not smart enough to analyze when key column is integral and literal is float (e.g. integral_col < 10.5); as a result, primes() and numbers() stayed unbounded, kept generating forever and query ran indefinitely.
To solve the issue, this PR adds the analysis capability of such scenario to KeyCondition. Thus, as a consequence, primes() and numbers() can now understand filter such as WHERE prime < 1e9 and only generate primes/numbers up to 1e9.
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
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.
The following query will not cause infinite loop anymore:
Additionally, given,
This prunes:
This did not prune. But after this PR, this will also prune:
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Allow index pruning and filter pushdown when an integral column is compared with a float literal; for example, predicates like
WHERE x < 10.5can now use the primary key for pruning, and filters such asprime < 1e9ornumber < 1e5are now pushed down for theprimes()andnumbers()table functions instead of causing unbounded execution. Closes #85167.Documentation entry for user-facing changes
Version info
26.3.1.446