xtern commented on code in PR #2789:
URL: https://github.com/apache/ignite-3/pull/2789#discussion_r1392500459


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/sql/ScriptParseResult.java:
##########
@@ -69,25 +80,33 @@ public List<StatementParseResult> results() {
     }
 
     /**
-     * Counts the number of {@link SqlDynamicParam} nodes in the tree.
+     * Adjusts the dynamic parameter indexes to match the single statement 
parameter indexes.
      */
     @NotThreadSafe
-    static class SqlDynamicParamsCounter extends SqlBasicVisitor<Object> {
-        int count;
+    private static final class SqlDynamicParamsAdjuster extends SqlShuttle {
+        private int counter;
 
         @Override
-        public @Nullable Object visit(SqlDynamicParam param) {
-            count++;
-
-            return null;
+        public SqlNode visit(SqlDynamicParam param) {
+            return new SqlDynamicParam(counter++, param.getParserPosition());
         }
 
-        int forNode(SqlNode node) {
-            count = 0;
+        /**
+         * Rewrites dynamic parameter nodes in the provided tree.

Review Comment:
   Done.



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

Reply via email to