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

EQL: Adds "fields" request field to the eql request (#68962) #69447

Merged
merged 6 commits into from
Feb 24, 2021

Conversation

astefan
Copy link
Contributor

@astefan astefan commented Feb 23, 2021

Backport of #68962.
(cherry picked from commit 22c880e)

@elasticmachine elasticmachine added the Team:QL (Deprecated) Meta label for query languages team label Feb 23, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

@@ -78,7 +101,14 @@ public BytesReference toBytes(XContentType type) {
hits = new ArrayList<>();
for (int i = 0; i < size; i++) {
BytesReference bytes = new RandomSource(() -> randomAlphaOfLength(10)).toBytes(xType);
hits.add(new Event(String.valueOf(i), randomAlphaOfLength(10), bytes));
Map<String, DocumentField> fetchFields = new HashMap<>();
for (int j = 0; j < randomIntBetween(0, 5); j++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be a var before the loop?

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

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

LGTM. Left 2 comments.

@@ -49,6 +59,55 @@ setup:
- match: {hits.events.1._id: "2"}
- match: {hits.events.2._id: "3"}

---
"Execute EQL events query with fields filtering":
- do:
Copy link
Contributor

Choose a reason for hiding this comment

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

should those have maybe the:

- skip:
      version: " - 7.12.99"

block?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess the 7.12 port will have the versions kept as in original PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There won't be a 7.12 port, only 7.x.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, right, >feature!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think the EQL yaml tests run in a mixed cluster (or any other bwc context) scenario that warrants for this skip block.

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment on lines 244 to 248
if (version.onOrAfter(Version.V_7_13_0)) {
mutatedEvents.add(new Event(e.index(), e.id(), e.source(), e.fetchFields()));
} else {
mutatedEvents.add(new Event(e.index(), e.id(), e.source(), null));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: optionally, you could add one line (or two) only, if you condition just last parameter's value by the version (like done in the Request test).

@astefan
Copy link
Contributor Author

astefan commented Feb 24, 2021

@elasticmachine update branch

@astefan astefan merged commit 6d77393 into elastic:7.x Feb 24, 2021
@astefan astefan deleted the 68962_7x_backport branch February 24, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/EQL EQL querying backport >feature Team:QL (Deprecated) Meta label for query languages team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants