Re-enable file skipping on timestamp columns based on maxValues stat #2
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.
Files skipping based on maxValues stat for Timestamps was disabled in PR below as per delta spec add.stats min/max values are truncated to milliseconds (not rounded up) so filter could filter out valid item
PR re-enables file skipping on timestamp columns by subtracting 999 microseconds from predicate value used for filtering keeping potentially good entries. Note -
DataSkippingPredicateEvaluatoronly performs initial filtering, final filtering is done based on actual data content/metadata so it is valid to relax filter here.The following approach was reviewed/considered as well: Instead of changing predicate value, generate comparison expression that substracts this value, but
1-Datafusion does not support Timestampt-Int64 (must be interval) and Delta Kernel and Delta spec does not have Interval type so introducing it seems to be unreasinable
2-Adjustment must be only based on knowledge of target operator (Greater vs Less) and if inversion is enabled/disabled so can't be always included into
get_max_statNext step is to add more test, update logic for minStat (review if logic needs to be adjusted for inverted=false) - I expect it is also affected the same way with inversion