korlov42 commented on a change in pull request #9084:
URL: https://github.com/apache/ignite/pull/9084#discussion_r633544339
##########
File path:
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/ExecutionServiceImpl.java
##########
@@ -674,16 +686,20 @@ private IgniteRel optimize(SqlNode sqlNode, IgnitePlanner
planner) {
}
/** */
+ // TODO: prepareExplain should reuse prepare* methods for different query
types
private QueryPlan prepareExplain(SqlNode explain, PlanningContext ctx)
throws ValidationException {
IgnitePlanner planner = ctx.planner();
SqlNode sql = ((SqlExplain)explain).getExplicandum();
// Validate
- explain = planner.validate(sql);
+ sql = planner.validate(sql);
// Convert to Relational operators graph
- IgniteRel igniteRel = optimize(explain, planner);
+ IgniteRel igniteRel = optimize(sql, planner);
+
+ if (sql.isA(ImmutableSet.of(SqlKind.INSERT, SqlKind.UPDATE)))
Review comment:
Yes, `prepareExplain` is a separate branch that explains all types of
other queries (regular query, DDL, DML).
I think I was wrong about putting shuttle to `prepare*` method. Looks like
`optimize` is better place since it's a common point for both `prepareDml` and
`prepareExplain`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]