lowka commented on code in PR #7703:
URL: https://github.com/apache/ignite-3/pull/7703#discussion_r2993961330


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/pruning/ModifyNodeVisitor.java:
##########
@@ -332,4 +401,98 @@ public RexNode visitInputRef(RexInputRef inputRef) {
 
         return null;
     }
+
+    private @Nullable List<List<RexNode>> extractValuesFromScan(
+            long sourceId,
+            IgniteTable table,
+            @Nullable ImmutableIntList requiredColumns,
+            @Nullable List<RexNode> projects
+    ) {
+        PartitionPruningColumns metadata = extractor.result.get(sourceId);
+        if (metadata == null) {
+            return null;

Review Comment:
   Ignore that comment, everything is going to work. 
   Fixed.



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/pruning/ModifyNodeVisitor.java:
##########
@@ -82,14 +98,59 @@ private ModifyNodeVisitor() {
      * <p>Every element from outer list contributes a partition, so after 
pruning all partitions defined by these
      * expressions must be preserved in the plan.
      *
+     * @param extractor Metadata extractor to use.
      * @param tableModify A modify node to start traversal from.
      * @return A list of expressions. It's guaranteed that returned collection 
represents complete set of partitions. Returns {@code null}
      *         otherwise.
      */
-    static @Nullable List<List<RexNode>> go(IgniteTableModify tableModify) {
-        var modifyNodeShuttle = new ModifyNodeVisitor();
+    static @Nullable List<List<@Nullable RexNode>> go(
+            PartitionPruningMetadataExtractor extractor,
+            IgniteTableModify tableModify
+    ) {
+        switch (tableModify.getOperation()) {
+            case INSERT:
+            case UPDATE: {
+                ModifyNodeVisitor visitor = new ModifyNodeVisitor(extractor);
+                return visitor.visit((IgniteRel) tableModify.getInput());
+            }
+            case DELETE: {
+                ModifyNodeVisitor visitor = new ModifyNodeVisitor(extractor);
+                List<List<RexNode>> values = visitor.visit((IgniteRel) 
tableModify.getInput());
+
+                if (nullOrEmpty(values)) {
+                    return null;
+                }
+

Review Comment:
   Fixed. 



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