morrySnow commented on code in PR #49206:
URL: https://github.com/apache/doris/pull/49206#discussion_r2000781022
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/PrepareCommand.java:
##########
@@ -99,6 +101,9 @@ public List<String> getLabels() {
@Override
public void run(ConnectContext ctx, StmtExecutor executor) throws
Exception {
List<String> labels = getLabels();
+ StatementContext statementContext = ctx.getStatementContext();
+ statementContext.setPrepareStage(true);
+ List<Slot> slots = logicalPlan instanceof InsertIntoTableCommand ?
null : executor.planPreparedStatementSlots();
Review Comment:
how about other command that could return result
##########
fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java:
##########
@@ -3476,6 +3506,17 @@ public StatementBase setParsedStmt(StatementBase
parsedStmt) {
return parsedStmt;
}
+ public List<Slot> planPreparedStatementSlots() throws Exception {
+ parseByNereids();
+ Preconditions.checkState(parsedStmt instanceof LogicalPlanAdapter,
+ "Nereids only process LogicalPlanAdapter,"
+ + " but parsedStmt is " +
parsedStmt.getClass().getName());
+ context.getState().setNereids(true);
+ NereidsPlanner nereidsPlanner = new NereidsPlanner(statementContext);
+ nereidsPlanner.plan(parsedStmt,
context.getSessionVariable().toThrift());
Review Comment:
what will happen if raise exception here?
--
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]