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

[core] Introduce InPredicateVisitor to refactor Predicate handle #4486

Merged
merged 7 commits into from
Nov 11, 2024

Conversation

xuzifu666
Copy link
Member

@xuzifu666 xuzifu666 commented Nov 9, 2024

Purpose

Linked issue: close #xxx
from: #4469

  1. Follow up [core] Optizime IN filter pushdown to snapshot/tag/schema system tables #4436 , refactor related logic to a util class to duplicate codes;
  2. Fix incidental ut failed due to order in schema test.

Tests

API and Format

Documentation

break;
}
}
Optional<List<Object>> leafs =
Copy link
Contributor

Choose a reason for hiding this comment

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

Why here has no judge of : (compoundPredicate.function() instanceof Or) ?
But SchemasTable and TagsTable both judged?

Comment on lines 243 to 254
Optional<List<Object>> leafs =
InPredicateVisitor.extractInElements(predicate, TAG_NAME);
if (leafs.isPresent()) {
leafs.get().stream()
.forEach(
leaf -> {
if (tagManager.tagExists(leaf.toString())) {
predicateMap.put(
leaf.toString(),
tagManager.tag(leaf.toString()));
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

InPredicateVisitor.extractInElements(predicate, TAG_NAME) .ifPresent(leafs -> leafs .forEach( leaf -> { String leftName = leaf.toString(); if (tagManager.tagExists(leftName)) { predicateMap.put( leftName, tagManager.tag(leftName)); } }));

Comment on lines 234 to 238
Optional<List<Object>> leafs =
InPredicateVisitor.extractInElements(predicate, leafName);
if (leafs.isPresent()) {
leafs.get().stream()
.forEach(leaf -> snapshotIds.add(Long.parseLong(leaf.toString())));
Copy link
Contributor

Choose a reason for hiding this comment

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

InPredicateVisitor.extractInElements(predicate, leafName)
.ifPresent(leafs -> leafs
.forEach(leaf -> snapshotIds.add(Long.parseLong(leaf.toString()))));

Comment on lines 233 to 237
Optional<List<Object>> leafs =
InPredicateVisitor.extractInElements(predicate, leafName);
if (leafs.isPresent()) {
leafs.get().stream()
.forEach(leaf -> schemaIds.add(Long.parseLong(leaf.toString())));
Copy link
Contributor

Choose a reason for hiding this comment

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

InPredicateVisitor.extractInElements(predicate, leafName) .ifPresent(leafs -> leafs .forEach(leaf -> schemaIds.add(Long.parseLong(leaf.toString()))));

public class InPredicateVisitor {

/**
* Method for handling with CompoundPredicate.
Copy link
Contributor

Choose a reason for hiding this comment

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

Method for handling with In CompoundPredicate

@xuzifu666
Copy link
Member Author

@wwj6591812 had addressed, Thanks.

@wwj6591812
Copy link
Contributor

+1

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit f19a4c9 into apache:master Nov 11, 2024
12 checks passed
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.

3 participants