-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-39396][table] Simplify early return condition in SqlLikeChainC… #27894
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
base: master
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -148,8 +148,22 @@ private Stream<TestSetSpec> withEscape() { | |
| DataTypes.STRING(), | ||
| DataTypes.STRING()) | ||
| // Empty strings in pattern or escape | ||
| .testSqlResult("f0 LIKE 'test\"end' ESCAPE ''", false, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f0 LIKE '' ESCAPE ''", false, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f0 LIKE '' ESCAPE '!'", false, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f0 LIKE 'test\"end' ESCAPE ''", false, DataTypes.BOOLEAN()) | ||
| // Escaped _ in quick path: startsWith (BEGIN_PATTERN) | ||
| .testSqlResult("f2 LIKE 'te!_%' ESCAPE '!'", true, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f0 LIKE 'te!_%' ESCAPE '!'", false, DataTypes.BOOLEAN()) | ||
|
|
||
| // Escaped _ in quick path: endsWith (END_PATTERN) | ||
| .testSqlResult("f2 LIKE '%!_st' ESCAPE '!'", true, DataTypes.BOOLEAN()) | ||
|
|
||
| // Escaped _ in quick path: contains (MIDDLE_PATTERN) | ||
| .testSqlResult("f2 LIKE '%!_s%' ESCAPE '!'", true, DataTypes.BOOLEAN()) | ||
|
|
||
| // Escaped _ in quick path: multi-segment (ChainChecker) | ||
| .testSqlResult("f2 LIKE 'te!_%st' ESCAPE '!'", true, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f0 LIKE 'te!_%st' ESCAPE '!'", false, DataTypes.BOOLEAN()) | ||
|
Comment on lines
+152
to
+166
Contributor
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. does any of this test fail without a fix?
Contributor
Author
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. At present, this is not a bug fix, but a technical debt |
||
| // Escaping with emoji | ||
| .testSqlResult("f0 LIKE 'test' ESCAPE '✅'", true, DataTypes.BOOLEAN()) | ||
| .testSqlResult("f1 LIKE 'test✅%' ESCAPE '✅'", true, DataTypes.BOOLEAN()) | ||
|
|
||
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.
what is the reason of this line removal?
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.
This line was not deleted, but placed on line 153
This is arranged according to the pattern-ESCAPE-escape format, with three tests being