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

#14 - Add proper support for string starts/ends operators #16

Merged
merged 1 commit into from
Nov 19, 2021
Merged

#14 - Add proper support for string starts/ends operators #16

merged 1 commit into from
Nov 19, 2021

Conversation

roele
Copy link
Contributor

@roele roele commented Sep 21, 2021

1. Issue Link:
#14

2. Brief explanation of a change:
Implement START/END string operators instead of falling through CONTAINS.

3. Will it break existing clients and code in production?
Can possibly be considered a breaking change as behaviour will be more restrictive with this change.

if (operator == Operator.CONTAINS || operator == Operator.STARTS || operator == Operator.ENDS ) {
if (operator == Operator.STARTS) {
expressionBuilder.append("'").append(expressionValues.get(0)).append("%").append("'");
} else if (operator == Operator.ENDS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets add tests for these operators in the SQLExpressionTest file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Added a test for each of those.

case ENDS:
predicate = criteriaBuilder.like(path, "%" + operandValue.value());
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding these cases.

@jaiswalsk
Copy link
Contributor

Looks Good! 🚀 Thanks @roele for your contributions.

@jaiswalsk jaiswalsk merged commit 7779a9c into intuit:master Nov 19, 2021
@roele roele deleted the issues/14 branch November 19, 2021 06:54
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.

2 participants