You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/11/23 08:11:41 UTC
[GitHub] [shardingsphere] xsong123 edited a comment on issue #13747: “case when” sql is by rewrited, then ORDER_BY_DERIVED is added and blank space[' '] miss
xsong123 edited a comment on issue #13747:
URL: https://github.com/apache/shardingsphere/issues/13747#issuecomment-976242209
override method getText() in class[ExpressionOrderByItemSegment]
package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.item;
import lombok.Generated;
import org.apache.shardingsphere.sql.parser.sql.common.constant.OrderDirection;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.ExpressionSegment;
import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.complex.CommonExpressionSegment;
public final class ExpressionOrderByItemSegment extends TextOrderByItemSegment {
private final String expression;
private final ExpressionSegment expr;
public ExpressionOrderByItemSegment(int startIndex, int stopIndex, String expression, OrderDirection orderDirection, OrderDirection nullOrderDirection) {
super(startIndex, stopIndex, orderDirection, nullOrderDirection);
this.expression = expression;
this.expr = null;
}
public ExpressionOrderByItemSegment(int startIndex, int stopIndex, String expression, OrderDirection orderDirection) {
super(startIndex, stopIndex, orderDirection, OrderDirection.ASC);
this.expression = expression;
this.expr = null;
}
public ExpressionOrderByItemSegment(int startIndex, int stopIndex, String expression, OrderDirection orderDirection, ExpressionSegment expr) {
super(startIndex, stopIndex, orderDirection, OrderDirection.ASC);
this.expression = expression;
this.expr = expr;
}
public String getText() {
return ((CommonExpressionSegment)this.expr).getText();
}
@Generated
public String getExpression() {
return this.expression;
}
@Generated
public ExpressionSegment getExpr() {
return this.expr;
}
@Generated
public String toString() {
return "ExpressionOrderByItemSegment(super=" + super.toString() + ", expression=" + this.getExpression() + ", expr=" + this.getExpr() + ")";
}
}
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org