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

[common] Minor refactor PredicateBuilder to avoid potential stack overflow #3517

Closed
wants to merge 3 commits into from

Conversation

yuzelin
Copy link
Contributor

@yuzelin yuzelin commented Jun 13, 2024

Purpose

The case is the upstream data changes too many partitions, make the Predicate too deep, then error is:

Caused by: java.lang.RuntimeException: java.lang.StackOverflowError
	at org.apache.paimon.manifest.ManifestFileMeta.merge(ManifestFileMeta.java:178)
	at org.apache.paimon.operation.FileStoreCommitImpl.tryCommitOnce(FileStoreCommitImpl.java:808)
	... 27 more
Caused by: java.lang.StackOverflowError
	at org.apache.paimon.predicate.CompoundPredicate.test(CompoundPredicate.java:59)
	at org.apache.paimon.predicate.Or.test(Or.java:55)
	at org.apache.paimon.predicate.CompoundPredicate.test(CompoundPredicate.java:59)
	...

Tests

API and Format

Documentation

return predicates.stream()
.reduce((a, b) -> new CompoundPredicate(And.INSTANCE, Arrays.asList(a, b)))
.get();
return new CompoundPredicate(And.INSTANCE, predicates);
Copy link
Contributor

Choose a reason for hiding this comment

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

Here should be careful... Let me think about this.

@JingsongLi
Copy link
Contributor

Finished in #3864

@JingsongLi JingsongLi closed this Jul 31, 2024
@yuzelin yuzelin deleted the minor_refactor branch July 31, 2024 12:06
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