-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Feature][Transform-V2][SqlTransform] Support Not Like Expression #5456
Changes from 1 commit
b9f8284
b88d766
cfe2c14
c4f83c3
9ba7417
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,7 +173,7 @@ private boolean likeExpr(LikeExpression likeExpression, Object[] inputFields) { | |
Pattern pattern = Pattern.compile(regex); | ||
Matcher matcher = pattern.matcher(leftVal.toString()); | ||
|
||
return matcher.matches(); | ||
return matcher.matches() ^ likeExpression.isNot(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we split There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's necessary to add a not like expression, because that's where the SQL engine expresses the match and mismatch logic. I'm referring to the IN expression logic |
||
} | ||
|
||
private Pair<Object, Object> executeComparisonOperator( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seem like this test case doesn't affect test result after change query, so that we can't make sure that the result is what we want, could you add a test case for
not like
expression to make sure it will filter right row?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
AssertSink
to check the result.A reference
seatunnel-e2e/seatunnel-transforms-v2-e2e/seatunnel-transforms-v2-e2e-part-2/src/test/resources/sql_transform/func_system.conf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK,I will add a test case