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

Finish refactoring IngestTypeVisitor, add datatype focused test #2347

Merged
merged 4 commits into from May 10, 2024

Conversation

apmoriarty
Copy link
Collaborator

@apmoriarty apmoriarty commented Apr 17, 2024

  • completed refactoring datatype-gathering logic from the IngestTypePruningVisitor to the IngestTypeVisitor.
  • add ShapesTest, a WiseGuys-style test with a focus on querying across datatypes
  • updated IngestTypePruningVisitor and IngestTypeVisitor tests based on integration testing

@apmoriarty apmoriarty force-pushed the task/colors-and-ingest-type-visitor-refactor branch from 05f8b42 to 820a244 Compare April 17, 2024 11:49
@apmoriarty apmoriarty force-pushed the task/colors-and-ingest-type-visitor-refactor branch from 320ca82 to fdcca13 Compare April 29, 2024 15:06
@apmoriarty apmoriarty force-pushed the task/colors-and-ingest-type-visitor-refactor branch 3 times, most recently from a94b830 to 0bc9071 Compare April 29, 2024 15:27
@apmoriarty apmoriarty requested a review from foster33 May 1, 2024 13:21
@@ -82,11 +83,13 @@ public static Set<String> getIngestTypes(JexlNode node, TypeMetadata typeMetadat
Object o = node.jjtAccept(visitor, null);
if (o instanceof Set) {
Set<String> ingestTypes = (Set<String>) o;
if (!ingestTypes.contains(UNKNOWN_TYPE)) {
if (ingestTypes.contains(UNKNOWN_TYPE)) {
ingestTypes.retainAll(Collections.singleton(UNKNOWN_TYPE));
return ingestTypes;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Duplicated return. Remove this one and the flow doesnt change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not quite, in this case I only want to return a collection that contains the UNKNOWN_TYPE. I'll add a comment to that effect.

@@ -438,7 +441,7 @@ public void testEvaluationOnlyField() {
@Test
public void testPruneNegation() {
String query = "A == '1' || !((_Delayed_ = true) && (A == '1' && C == '2'))";
test(query, "A == '1'");
test(query, query);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this indicate we are not pruning the negation, if the expected now has the negation included?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Previously the negation would self-prune, let me take a closer look at why this stopped visiting the negated branch..

Copy link
Collaborator

@alerman alerman left a comment

Choose a reason for hiding this comment

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

Just a few small things. Nothing too major. Please check the unit test with changed expected output.

@apmoriarty apmoriarty force-pushed the task/colors-and-ingest-type-visitor-refactor branch from 64e2bfa to 815e48c Compare May 2, 2024 19:13
@apmoriarty apmoriarty force-pushed the task/colors-and-ingest-type-visitor-refactor branch from 815e48c to 3fe6790 Compare May 10, 2024 09:17
Copy link
Collaborator

@MiguelRicardos MiguelRicardos left a comment

Choose a reason for hiding this comment

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

Nice work!

@apmoriarty apmoriarty merged commit 0046319 into integration May 10, 2024
3 checks passed
@apmoriarty apmoriarty deleted the task/colors-and-ingest-type-visitor-refactor branch May 10, 2024 18:05
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

5 participants