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
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 (" " );
Original file line number Diff line number Diff 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);
You can’t perform that action at this time.
0 commit comments