File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
java/net/sf/jsqlparser/expression
jjtree/net/sf/jsqlparser/parser Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ public class AnalyticExpression extends ASTNodeAccessImpl implements Expression
47
47
private KeepExpression keep = null ;
48
48
private AnalyticType type = AnalyticType .OVER ;
49
49
private boolean distinct = false ;
50
+ private boolean ignoreNulls = false ;
50
51
51
52
@ Override
52
53
public void accept (ExpressionVisitor expressionVisitor ) {
@@ -133,6 +134,14 @@ public void setDistinct(boolean distinct) {
133
134
this .distinct = distinct ;
134
135
}
135
136
137
+ public boolean isIgnoreNulls () {
138
+ return ignoreNulls ;
139
+ }
140
+
141
+ public void setIgnoreNulls (boolean ignoreNulls ) {
142
+ this .ignoreNulls = ignoreNulls ;
143
+ }
144
+
136
145
@ Override
137
146
public String toString () {
138
147
StringBuilder b = new StringBuilder ();
@@ -152,6 +161,9 @@ public String toString() {
152
161
} else if (isAllColumns ()) {
153
162
b .append ("*" );
154
163
}
164
+ if (isIgnoreNulls ()) {
165
+ b .append (" IGNORE NULLS" );
166
+ }
155
167
b .append (") " );
156
168
if (keep != null ) {
157
169
b .append (keep .toString ()).append (" " );
Original file line number Diff line number Diff line change @@ -2690,12 +2690,14 @@ AnalyticExpression AnalyticExpression() :
2690
2690
WindowElement windowElement = null;
2691
2691
KeepExpression keep = null;
2692
2692
boolean distinct = false;
2693
+ boolean ignoreNulls = false;
2693
2694
}
2694
2695
{
2695
2696
token=<S_IDENTIFIER> { retval.setName(token.image); }
2696
2697
"(" [
2697
2698
[ <K_DISTINCT> {distinct = true;} ]
2698
2699
(expr=SimpleExpression() ["," offset=SimpleExpression() ["," defaultValue=SimpleExpression() ]] | "*" { retval.setAllColumns(true); } )
2700
+ [ <K_IGNORE> <K_NULLS> {ignoreNulls = true;}]
2699
2701
] ")"
2700
2702
2701
2703
[ keep=KeepExpression() ]
@@ -2709,6 +2711,7 @@ AnalyticExpression AnalyticExpression() :
2709
2711
2710
2712
{
2711
2713
retval.setDistinct(distinct);
2714
+ retval.setIgnoreNulls(ignoreNulls);
2712
2715
retval.setExpression(expr);
2713
2716
retval.setOffset(offset);
2714
2717
retval.setDefaultValue(defaultValue);
You can’t perform that action at this time.
0 commit comments