-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add support for parameters in LIMIT command #128464
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
Add support for parameters in LIMIT command #128464
Conversation
@@ -384,8 +382,18 @@ public PlanFactory visitWhereCommand(EsqlBaseParser.WhereCommandContext ctx) { | |||
@Override | |||
public PlanFactory visitLimitCommand(EsqlBaseParser.LimitCommandContext ctx) { | |||
Source source = source(ctx); | |||
int limit = stringToInt(ctx.INTEGER_LITERAL().getText()); | |||
return input -> new Limit(source, new Literal(source, limit, DataType.INTEGER), input); | |||
Object val = expression(ctx.constant()).fold(FoldContext.small() /* TODO remove me */); |
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.
Doing this here for consistency with the previous behavior and to fail fast, but it could be moved to the verification phase
Pinging @elastic/es-analytical-engine (Team:Analytics) |
Hi @luigidellaquila, I've created a changelog YAML for you. |
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.
LGTM, thank you @luigidellaquila !
…into esql/limit_with_param
Manual backport: #128655 |
Adding support for positional and named parameters in LIMIT command, eg.