Skip to content

Commit 138412c

Browse files
committed
Merge origin/master
2 parents e6b9afd + 3950b19 commit 138412c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/java/net/sf/jsqlparser/expression/AnalyticExpression.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class AnalyticExpression extends ASTNodeAccessImpl implements Expression
4747
private KeepExpression keep = null;
4848
private AnalyticType type = AnalyticType.OVER;
4949
private boolean distinct = false;
50+
private boolean ignoreNulls = false;
5051

5152
@Override
5253
public void accept(ExpressionVisitor expressionVisitor) {
@@ -133,6 +134,14 @@ public void setDistinct(boolean distinct) {
133134
this.distinct = distinct;
134135
}
135136

137+
public boolean isIgnoreNulls() {
138+
return ignoreNulls;
139+
}
140+
141+
public void setIgnoreNulls(boolean ignoreNulls) {
142+
this.ignoreNulls = ignoreNulls;
143+
}
144+
136145
@Override
137146
public String toString() {
138147
StringBuilder b = new StringBuilder();
@@ -152,6 +161,9 @@ public String toString() {
152161
} else if (isAllColumns()) {
153162
b.append("*");
154163
}
164+
if (isIgnoreNulls()) {
165+
b.append(" IGNORE NULLS");
166+
}
155167
b.append(") ");
156168
if (keep != null) {
157169
b.append(keep.toString()).append(" ");

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2690,12 +2690,14 @@ AnalyticExpression AnalyticExpression() :
26902690
WindowElement windowElement = null;
26912691
KeepExpression keep = null;
26922692
boolean distinct = false;
2693+
boolean ignoreNulls = false;
26932694
}
26942695
{
26952696
token=<S_IDENTIFIER> { retval.setName(token.image); }
26962697
"(" [
26972698
[ <K_DISTINCT> {distinct = true;} ]
26982699
(expr=SimpleExpression() ["," offset=SimpleExpression() ["," defaultValue=SimpleExpression() ]] | "*" { retval.setAllColumns(true); } )
2700+
[ <K_IGNORE> <K_NULLS> {ignoreNulls = true;}]
26992701
] ")"
27002702

27012703
[ keep=KeepExpression() ]
@@ -2709,6 +2711,7 @@ AnalyticExpression AnalyticExpression() :
27092711

27102712
{
27112713
retval.setDistinct(distinct);
2714+
retval.setIgnoreNulls(ignoreNulls);
27122715
retval.setExpression(expr);
27132716
retval.setOffset(offset);
27142717
retval.setDefaultValue(defaultValue);

0 commit comments

Comments
 (0)