morrySnow commented on code in PR #15530:
URL: https://github.com/apache/doris/pull/15530#discussion_r1059459698
##########
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -166,7 +166,7 @@ sortClause
;
sortItem
- : expression ordering = (ASC | DESC)?
+ : expression ordering = (ASC | DESC)? ( NULLS FIRST | NULLS LAST )?
Review Comment:
nit:
```suggestion
: expression ordering = (ASC | DESC)? (NULLS (LAST | FIRST))?
```
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -1076,8 +1076,7 @@ public List<String>
visitIdentifierSeq(IdentifierSeqContext ctx) {
public OrderKey visitSortItem(SortItemContext ctx) {
return ParserUtils.withOrigin(ctx, () -> {
boolean isAsc = ctx.DESC() == null;
- // TODO(wj): isNullFirst
- boolean isNullFirst = true;
+ boolean isNullFirst = !(ctx.NULLS() != null && ctx.LAST() != null);
Review Comment:
nit:
```suggestion
boolean isNullFirst = ctx.LAST() == null;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]