-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for SELECT special functions #24888
support for SELECT special functions #24888
Conversation
@strongduanmu Hello, I request you to review it please. |
Hi @kanha-gupta, can you refer issue #24200 for this pr? |
@strongduanmu Hello Expected: is <44> XML code already have expected value at stop index |
test/it/parser/src/main/resources/case/dml/select-special-function.xml
Outdated
Show resolved
Hide resolved
test/it/parser/src/main/resources/case/dml/select-special-function.xml
Outdated
Show resolved
Hide resolved
@strongduanmu Hello, |
Hi @kanha-gupta, can you merge master branch? |
@strongduanmu Done, please check. |
@@ -966,7 +971,9 @@ public final ASTNode visitTrimFunction(final TrimFunctionContext ctx) { | |||
@Override | |||
public final ASTNode visitWeightStringFunction(final WeightStringFunctionContext ctx) { | |||
calculateParameterCount(Collections.singleton(ctx.expr())); | |||
return new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.WEIGHT_STRING().getText(), getOriginalText(ctx)); | |||
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.WEIGHT_STRING().getText(), getOriginalText(ctx)); | |||
result.getParameters().add((LiteralExpressionSegment) visit(ctx.expr())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think use (ExpressionSegment) visit(ctx.expr())
is better? (LiteralExpressionSegment) visit(ctx.expr())
will cause class cast exception.
FunctionSegment result = new FunctionSegment(ctx.getStart().getStartIndex(), ctx.getStop().getStopIndex(), ctx.CHAR().getText(), getOriginalText(ctx)); | ||
for (ExprContext each : ctx.expr()) { | ||
ASTNode expr = visit(each); | ||
result.getParameters().add((LiteralExpressionSegment) expr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think use (ExpressionSegment) visit(ctx.expr())
is better? (LiteralExpressionSegment) visit(ctx.expr())
will cause class cast exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, merged.
Ref #24200 .
Changes proposed in this pull request:
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.