-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: add missing public Getter Add public Getter for `updateSets` Fixes #1630 * feat: LISTAGG() with OVER() clause fixes issue #1652 fixes 3 more Special Oracle Tests * fix: White-list CURRENT_DATE and CURRENT_TIMESTAMP tokens allows CURRENT_DATE(3) and CURRENT_TIMESTAMP(3) as regular functions fixes #1507 fixes #1607 * feat: Deparser for Expression Lists Visit each Expression of a List instead ExpressionList.toString() fixes #1608 * fix: Lookahead needed
- Loading branch information
1 parent
e186588
commit bff268a
Showing
20 changed files
with
250 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -12,5 +12,7 @@ | |
public enum AnalyticType { | ||
OVER, | ||
WITHIN_GROUP, | ||
|
||
WITHIN_GROUP_OVER, | ||
FILTER_ONLY | ||
} |
This file contains 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 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 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 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 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 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 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
52 changes: 52 additions & 0 deletions
52
src/main/java/net/sf/jsqlparser/util/deparser/ExpressionListDeParser.java
This file contains 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,52 @@ | ||
/*- | ||
* #%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.util.deparser; | ||
|
||
import net.sf.jsqlparser.expression.Expression; | ||
import net.sf.jsqlparser.expression.ExpressionVisitor; | ||
|
||
import java.util.Collection; | ||
|
||
public class ExpressionListDeParser extends AbstractDeParser<Collection<Expression>> { | ||
|
||
private final ExpressionVisitor expressionVisitor; | ||
private final boolean useBrackets; | ||
private final boolean useComma; | ||
|
||
public ExpressionListDeParser(ExpressionVisitor expressionVisitor, StringBuilder builder, boolean useBrackets, boolean useComma) { | ||
super(builder); | ||
this.expressionVisitor = expressionVisitor; | ||
this.useBrackets = useBrackets; | ||
this.useComma = useComma; | ||
} | ||
|
||
@Override | ||
public void deParse(Collection<Expression> expressions) { | ||
if (expressions != null) { | ||
String comma = useComma ? ", " : " "; | ||
if (useBrackets) { | ||
buffer.append("("); | ||
} | ||
int i=0; | ||
int size = expressions.size() - 1; | ||
for (Expression expression: expressions) { | ||
expression.accept(expressionVisitor); | ||
if (i<size) { | ||
buffer.append(comma); | ||
} | ||
i++; | ||
} | ||
|
||
if (useBrackets) { | ||
buffer.append(")"); | ||
} | ||
} | ||
} | ||
} |
This file contains 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 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.