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

Add option to sort query by field cardinality #2425

Open
wants to merge 7 commits into
base: integration
Choose a base branch
from

Conversation

apmoriarty
Copy link
Collaborator

@apmoriarty apmoriarty commented Jun 20, 2024

Update the sortQueryBeforeGlobalIndex option to get field cardinality from the DatawaveMetadata table

  • integrates bugfix from in-memory-accumulo 4.0.1
  • integrates forthcoming feature in metadata-utils 4.0.2
  • bugfix for how QueryFieldVisitor handles method terms like FOO.min() == 1
  • corrected test data format for datawave metadata F column

Note: until metadata-utils #37 is merged and the 4.0.2 tag created, this build will fail.

@apmoriarty apmoriarty force-pushed the task/metadata-utils-field-cardinality branch from 9dac86c to 0066649 Compare June 25, 2024 09:51
@@ -2796,6 +2797,20 @@ public Tuple2<CloseableIterable<QueryPlan>,Boolean> getQueryRanges(ScannerFactor
return new Tuple2<>(ranges, needsFullTable);
}

protected ASTJexlScript timedSortQueryBeforeGlobalIndex(ShardQueryConfiguration config, MetadataHelper metadataHelper) throws DatawaveQueryException {
return visitorManager.timedVisit(config.getTimers(), "SortQueryBeforeGlobalIndex", () -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am missing if there is a test that covers this change. Is there a way to test that it did what we want? Maybe testing the final plan to see that is is different when isSortQueryBeforeGlobalIndex is set to true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a test to verify the query terms are re-ordered by field cardinality and discovered another problem with the RebuildingScannerHelper which led to it's removal from a test.

…e test framework to not use rebuilding scanner helper due to incompatible usages of interfaces
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.

None yet

2 participants