-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Exasol support #2046
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
Merged
Merged
Exasol support #2046
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
1155036
feat: Support REGEXP_LIKE as LikeExpression
618acbb
feat: Support sub select as part of function parameters
6941dc3
fix: Resolve merge conflict
0b4512e
fix: Readd mistakenly removed K_TEXT_LITERAL
d05c21b
revert: Revert code formatting changes
7db7578
fix: Fix choice conflicts
6cdfe31
refactor: Rename test methods
a90ad74
refactor: Apply on changed files
345ec1b
feat: Introduce allowUnparenthesizedSubSelects feature
09ea6b8
refactor: Apply formatApply
351a61d
test: add test for the standard grammar, expected to fail
manticore-projects eb7e1b8
test: make the performance tests more robust regarding the time-outs
manticore-projects 45c7ef0
style: reformat code
manticore-projects ed99a28
chore: Resolve merge conflicts
862c5b1
fix: Revert default keyword changes
8080357
fix: Revert default keyword changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
feat: Support REGEXP_LIKE as LikeExpression
Implement support of REGEXP_LIKE as LikeExpression as described here: https://docs.exasol.com/db/latest/sql_references/predicates/not_regexp_like.htm
- Loading branch information
There are no files selected for viewing
252 changes: 126 additions & 126 deletions
252
src/main/java/net/sf/jsqlparser/expression/operators/relational/LikeExpression.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,126 +1,126 @@ | ||
| /*- | ||
| * #%L | ||
| * JSQLParser library | ||
| * %% | ||
| * Copyright (C) 2004 - 2019 JSQLParser | ||
| * %% | ||
| * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
| * #L% | ||
| */ | ||
| package net.sf.jsqlparser.expression.operators.relational; | ||
|
|
||
| import net.sf.jsqlparser.expression.BinaryExpression; | ||
| import net.sf.jsqlparser.expression.Expression; | ||
| import net.sf.jsqlparser.expression.ExpressionVisitor; | ||
|
|
||
| public class LikeExpression extends BinaryExpression { | ||
| private boolean not = false; | ||
| private boolean useBinary = false; | ||
| private Expression escapeExpression = null; | ||
| private KeyWord likeKeyWord = KeyWord.LIKE; | ||
|
|
||
| public boolean isNot() { | ||
| return not; | ||
| } | ||
|
|
||
| public void setNot(boolean b) { | ||
| not = b; | ||
| } | ||
|
|
||
| public boolean isUseBinary() { | ||
| return useBinary; | ||
| } | ||
|
|
||
| public LikeExpression setUseBinary(boolean useBinary) { | ||
| this.useBinary = useBinary; | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
| return expressionVisitor.visit(this, context); | ||
| } | ||
|
|
||
| @Deprecated | ||
| @Override | ||
| public String getStringExpression() { | ||
| return likeKeyWord.toString(); | ||
| } | ||
|
|
||
| @Override | ||
| public String toString() { | ||
| String retval = getLeftExpression() + " " + (not ? "NOT " : "") | ||
| + (likeKeyWord == KeyWord.SIMILAR_TO ? "SIMILAR TO" : likeKeyWord) + " " | ||
| + (useBinary ? "BINARY " : "") + getRightExpression(); | ||
| if (escapeExpression != null) { | ||
| retval += " ESCAPE " + escapeExpression; | ||
| } | ||
| return retval; | ||
| } | ||
|
|
||
| public Expression getEscape() { | ||
| return escapeExpression; | ||
| } | ||
|
|
||
| public void setEscape(Expression escapeExpression) { | ||
| this.escapeExpression = escapeExpression; | ||
| } | ||
|
|
||
| @Deprecated | ||
| public boolean isCaseInsensitive() { | ||
| return likeKeyWord == KeyWord.ILIKE; | ||
| } | ||
|
|
||
| @Deprecated | ||
| public void setCaseInsensitive(boolean caseInsensitive) { | ||
| this.likeKeyWord = KeyWord.ILIKE; | ||
| } | ||
|
|
||
| public KeyWord getLikeKeyWord() { | ||
| return likeKeyWord; | ||
| } | ||
|
|
||
| public LikeExpression setLikeKeyWord(KeyWord likeKeyWord) { | ||
| this.likeKeyWord = likeKeyWord; | ||
| return this; | ||
| } | ||
|
|
||
| public LikeExpression setLikeKeyWord(String likeKeyWord) { | ||
| this.likeKeyWord = KeyWord.from(likeKeyWord); | ||
| return this; | ||
| } | ||
|
|
||
| public LikeExpression withEscape(Expression escape) { | ||
| this.setEscape(escape); | ||
| return this; | ||
| } | ||
|
|
||
| @Deprecated | ||
| public LikeExpression withCaseInsensitive(boolean caseInsensitive) { | ||
| this.setCaseInsensitive(caseInsensitive); | ||
| return this; | ||
| } | ||
|
|
||
| public LikeExpression withNot(boolean not) { | ||
| this.setNot(not); | ||
| return this; | ||
| } | ||
|
|
||
| @Override | ||
| public LikeExpression withLeftExpression(Expression arg0) { | ||
| return (LikeExpression) super.withLeftExpression(arg0); | ||
| } | ||
|
|
||
| @Override | ||
| public LikeExpression withRightExpression(Expression arg0) { | ||
| return (LikeExpression) super.withRightExpression(arg0); | ||
| } | ||
|
|
||
| public enum KeyWord { | ||
| LIKE, ILIKE, RLIKE, REGEXP, SIMILAR_TO; | ||
|
|
||
| public static KeyWord from(String keyword) { | ||
| return Enum.valueOf(KeyWord.class, keyword.toUpperCase().replaceAll("\\s+", "_")); | ||
| } | ||
| } | ||
| } | ||
| /*- | ||
| * #%L | ||
| * JSQLParser library | ||
| * %% | ||
| * Copyright (C) 2004 - 2019 JSQLParser | ||
| * %% | ||
| * Dual licensed under GNU LGPL 2.1 or Apache License 2.0 | ||
| * #L% | ||
| */ | ||
| package net.sf.jsqlparser.expression.operators.relational; | ||
| import net.sf.jsqlparser.expression.BinaryExpression; | ||
| import net.sf.jsqlparser.expression.Expression; | ||
| import net.sf.jsqlparser.expression.ExpressionVisitor; | ||
| public class LikeExpression extends BinaryExpression { | ||
| private boolean not = false; | ||
| private boolean useBinary = false; | ||
| private Expression escapeExpression = null; | ||
| private KeyWord likeKeyWord = KeyWord.LIKE; | ||
| public boolean isNot() { | ||
| return not; | ||
| } | ||
| public void setNot(boolean b) { | ||
| not = b; | ||
| } | ||
| public boolean isUseBinary() { | ||
| return useBinary; | ||
| } | ||
| public LikeExpression setUseBinary(boolean useBinary) { | ||
| this.useBinary = useBinary; | ||
| return this; | ||
| } | ||
| @Override | ||
| public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
| return expressionVisitor.visit(this, context); | ||
| } | ||
| @Deprecated | ||
| @Override | ||
| public String getStringExpression() { | ||
| return likeKeyWord.toString(); | ||
| } | ||
| @Override | ||
| public String toString() { | ||
| String retval = getLeftExpression() + " " + (not ? "NOT " : "") | ||
| + (likeKeyWord == KeyWord.SIMILAR_TO ? "SIMILAR TO" : likeKeyWord) + " " | ||
| + (useBinary ? "BINARY " : "") + getRightExpression(); | ||
| if (escapeExpression != null) { | ||
| retval += " ESCAPE " + escapeExpression; | ||
| } | ||
| return retval; | ||
| } | ||
| public Expression getEscape() { | ||
| return escapeExpression; | ||
| } | ||
| public void setEscape(Expression escapeExpression) { | ||
| this.escapeExpression = escapeExpression; | ||
| } | ||
| @Deprecated | ||
| public boolean isCaseInsensitive() { | ||
| return likeKeyWord == KeyWord.ILIKE; | ||
| } | ||
| @Deprecated | ||
| public void setCaseInsensitive(boolean caseInsensitive) { | ||
| this.likeKeyWord = KeyWord.ILIKE; | ||
| } | ||
| public KeyWord getLikeKeyWord() { | ||
| return likeKeyWord; | ||
| } | ||
| public LikeExpression setLikeKeyWord(KeyWord likeKeyWord) { | ||
| this.likeKeyWord = likeKeyWord; | ||
| return this; | ||
| } | ||
| public LikeExpression setLikeKeyWord(String likeKeyWord) { | ||
| this.likeKeyWord = KeyWord.from(likeKeyWord); | ||
| return this; | ||
| } | ||
| public LikeExpression withEscape(Expression escape) { | ||
| this.setEscape(escape); | ||
| return this; | ||
| } | ||
| @Deprecated | ||
| public LikeExpression withCaseInsensitive(boolean caseInsensitive) { | ||
| this.setCaseInsensitive(caseInsensitive); | ||
| return this; | ||
| } | ||
| public LikeExpression withNot(boolean not) { | ||
| this.setNot(not); | ||
| return this; | ||
| } | ||
| @Override | ||
| public LikeExpression withLeftExpression(Expression arg0) { | ||
| return (LikeExpression) super.withLeftExpression(arg0); | ||
| } | ||
| @Override | ||
| public LikeExpression withRightExpression(Expression arg0) { | ||
| return (LikeExpression) super.withRightExpression(arg0); | ||
| } | ||
| public enum KeyWord { | ||
| LIKE, ILIKE, RLIKE, REGEXP_LIKE, REGEXP, SIMILAR_TO; | ||
| public static KeyWord from(String keyword) { | ||
| return Enum.valueOf(KeyWord.class, keyword.toUpperCase().replaceAll("\\s+", "_")); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.