Skip to content

EQL: endsWith function implementation#54442

Merged
astefan merged 6 commits intoelastic:masterfrom
astefan:53854_impl
Mar 31, 2020
Merged

EQL: endsWith function implementation#54442
astefan merged 6 commits intoelastic:masterfrom
astefan:53854_impl

Conversation

@astefan
Copy link
Copy Markdown
Contributor

@astefan astefan commented Mar 30, 2020

Addresses #53854

@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-ql (:Query Languages/EQL)

Copy link
Copy Markdown
Contributor

@aleksmaus aleksmaus left a comment

Choose a reason for hiding this comment

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

one nit, otherwise LGTM

}

EndsWithFunctionPipe other = (EndsWithFunctionPipe) obj;
return Objects.equals(source, other.source)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: the getters were used instead in the previous PR and EndsWithFunctionProcessor. maybe make it consistent.

throw new EqlIllegalArgumentException("A string/char is required; received [{}]", pattern);
}

return source.toString().toLowerCase(Locale.ROOT).endsWith(pattern.toString().toLowerCase(Locale.ROOT));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

based off some of the conversations that have been happening, I think we're going to outsource this to something else eventually.
I don't know if that means we should do case-sensitivity in all PRs now, or come back to this later

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO, this covers the feature parity with the original EQL implementation, and passes test against the EQL test data/queries.
We can merge this as is and keep iterating and moving forward.
Also this gives us a chance to refactor some of the code that can be better shared/reused across all of the functions implementations better.

Copy link
Copy Markdown
Member

@costin costin left a comment

Choose a reason for hiding this comment

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

LGTM.

The string functions have a lot of boilerplate in common and after this PR gets in, it's worth revisiting and extracting a common class for them.

@astefan astefan merged commit 554a4c8 into elastic:master Mar 31, 2020
@astefan astefan deleted the 53854_impl branch March 31, 2020 13:52
astefan added a commit to astefan/elasticsearch that referenced this pull request Mar 31, 2020
astefan added a commit that referenced this pull request Mar 31, 2020
* EQL: startsWith function implementation (#54400)

(cherry picked from commit 666719f)

* EQL: endsWith function implementation (#54442)

(cherry picked from commit 554a4c8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants