alex-plekhanov commented on a change in pull request #9084:
URL: https://github.com/apache/ignite/pull/9084#discussion_r633533293



##########
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:
       Got it, `prepareDml` is executed only for insert, update and delete, so 
it's not so important there.




-- 
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]


Reply via email to