Skip to content

Conversation

@lliangyu-lin
Copy link
Contributor

@lliangyu-lin lliangyu-lin commented Aug 2, 2025

Description

  • Add implementation for strict metrics evaluator
  • Unlike inclusive metrics evaluator, strict metrics evaluator will only return true or should read the data file will when the expression exactly matched by the manifest statistics.
  • This is being used as part of [DRAFT] feat(table): Support table delete with copy on write #518 for checking whether we could directly mark a manifest entry as deleted in the manifest file if all the records in the data file matched the predicate.

Testing

  • Added in evaluators_test.go

Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

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

Looks good other than the one issue

Comment on lines +1459 to +1461
if cmp(upperBound, lit) == -1 {
return rowsMustMatch
}
Copy link
Member

Choose a reason for hiding this comment

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

if there was no lower bound in the stats, this will panic because cmp will be nil. It'll never get set if there's no lower bound. we should avoid that 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this! I think inclusiveMetrics might have the same issue as well https://github.com/apache/iceberg-go/blob/main/table/evaluators.go#L1000

Copy link
Member

Choose a reason for hiding this comment

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

Looks like you're right, can you add the fix there too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, actually already fixed it in my new commit

@zeroshade zeroshade merged commit 14ba5ab into apache:main Aug 6, 2025
11 checks passed
@lliangyu-lin lliangyu-lin deleted the strict-metrics branch August 6, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants