Skip to content

Conversation

@sgrebnov
Copy link

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 - DataSkippingPredicateEvaluator only 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_stat

Next 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

@sgrebnov sgrebnov changed the title Re-enable file skipping on timestamp columns Re-enable file skipping on timestamp columns for maxValues / Greater Sep 17, 2025
@sgrebnov sgrebnov changed the title Re-enable file skipping on timestamp columns for maxValues / Greater Re-enable file skipping on timestamp columns based on maxValues stat Sep 18, 2025
@sgrebnov sgrebnov merged commit 0e5d8bc into spiceai-0.14.0 Sep 18, 2025
9 of 36 checks passed
@sgrebnov
Copy link
Author

Upstream PR created: delta-io#1333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants