-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Skyline syntax (preferring clause) #2078
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
manticore-projects
merged 6 commits into
JSQLParser:master
from
ssteinhauser:feature/skyline-syntax
Sep 17, 2024
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c2f3305
feat: Implement skyline syntax (preferring clause)
3e2c46b
fix: Fix codacy errors
3ef53c9
style: Execute :spotlessApply
dd06a17
fix: Remove unused import
90e852a
refactor: Replace wildcard imports
29e633e
refactor: Remove redundant imports
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
There are no files selected for viewing
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
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
42 changes: 42 additions & 0 deletions
42
src/main/java/net/sf/jsqlparser/expression/HighExpression.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*- | ||
* #%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; | ||
|
||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl; | ||
|
||
public class HighExpression extends ASTNodeAccessImpl implements Expression { | ||
private Expression expression; | ||
|
||
public HighExpression() { | ||
// empty constructor | ||
} | ||
|
||
public HighExpression(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
return expressionVisitor.visit(this, context); | ||
} | ||
|
||
public Expression getExpression() { | ||
return expression; | ||
} | ||
|
||
public void setExpression(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "HIGH " + expression.toString(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*- | ||
* #%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; | ||
|
||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl; | ||
|
||
public class Inverse extends ASTNodeAccessImpl implements Expression { | ||
private Expression expression; | ||
|
||
public Inverse() { | ||
// empty constructor | ||
} | ||
|
||
public Inverse(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
return expressionVisitor.visit(this, context); | ||
} | ||
|
||
public Expression getExpression() { | ||
return expression; | ||
} | ||
|
||
public void setExpression(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "INVERSE (" + expression.toString() + ")"; | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/net/sf/jsqlparser/expression/LowExpression.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*- | ||
* #%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; | ||
|
||
import net.sf.jsqlparser.parser.ASTNodeAccessImpl; | ||
|
||
public class LowExpression extends ASTNodeAccessImpl implements Expression { | ||
private Expression expression; | ||
|
||
public LowExpression() { | ||
// empty constructor | ||
} | ||
|
||
public LowExpression(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
return expressionVisitor.visit(this, context); | ||
} | ||
|
||
public Expression getExpression() { | ||
return expression; | ||
} | ||
|
||
public void setExpression(Expression expression) { | ||
this.expression = expression; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "LOW " + expression.toString(); | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/net/sf/jsqlparser/expression/PreferringClause.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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*- | ||
* #%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; | ||
|
||
import net.sf.jsqlparser.expression.operators.relational.ExpressionList; | ||
|
||
import java.io.Serializable; | ||
|
||
public class PreferringClause implements Serializable { | ||
private Expression preferring; | ||
private PartitionByClause partitionBy; | ||
|
||
public PreferringClause(Expression preferring) { | ||
this.preferring = preferring; | ||
} | ||
|
||
public void setPartitionExpressionList(ExpressionList expressionList, | ||
boolean brackets) { | ||
if (this.partitionBy == null) { | ||
this.partitionBy = new PartitionByClause(); | ||
} | ||
partitionBy.setPartitionExpressionList(expressionList, brackets); | ||
} | ||
|
||
public void toStringPreferring(StringBuilder b) { | ||
b.append("PREFERRING "); | ||
b.append(preferring.toString()); | ||
|
||
if (partitionBy != null) { | ||
b.append(" "); | ||
partitionBy.toStringPartitionBy(b); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
toStringPreferring(sb); | ||
return sb.toString(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/sf/jsqlparser/expression/operators/relational/Plus.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*- | ||
* #%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 Plus extends BinaryExpression { | ||
public Plus(Expression leftExpression, Expression rightExpression) { | ||
super(leftExpression, rightExpression); | ||
} | ||
|
||
@Override | ||
public String getStringExpression() { | ||
return "PLUS"; | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
return expressionVisitor.visit(this, context); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/net/sf/jsqlparser/expression/operators/relational/PriorTo.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/*- | ||
* #%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 PriorTo extends BinaryExpression { | ||
public PriorTo(Expression leftExpression, Expression rightExpression) { | ||
super(leftExpression, rightExpression); | ||
} | ||
|
||
@Override | ||
public String getStringExpression() { | ||
return "PRIOR TO"; | ||
} | ||
|
||
@Override | ||
public <T, S> T accept(ExpressionVisitor<T> expressionVisitor, S context) { | ||
return expressionVisitor.visit(this, context); | ||
} | ||
} |
Oops, something went wrong.
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.