zstan commented on code in PR #3335:
URL: https://github.com/apache/ignite-3/pull/3335#discussion_r1524350969
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/pruning/PartitionPruningMetadataExtractor.java:
##########
@@ -137,6 +150,153 @@ public IgniteRel visit(IgniteTableScan rel) {
return rel;
}
+ private static class ModifyNodeShuttle extends IgniteRelShuttle {
+ List<RexNode> projections = null;
+ IgniteValues values = null;
+ List<List<RexNode>> exprProjections = null;
+ boolean collectExprProjections = false;
+
+ /** {@inheritDoc} */
+ @Override
+ public IgniteRel visit(IgniteProject rel) {
+ if (projections == null && !collectExprProjections) {
+ projections = rel.getProjects();
+ } else {
+ if (exprProjections == null) {
+ exprProjections = new ArrayList<>();
+ }
+ exprProjections.add(rel.getProjects());
+ }
+ return super.visit(rel);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IgniteRel visit(IgniteValues rel) {
+ if (!collectExprProjections) {
+ values = rel;
+ }
+ return super.visit(rel);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IgniteRel visit(IgniteUnionAll rel) {
+ collectExprProjections = true;
+ return super.visit(rel);
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public IgniteRel visit(IgniteTableModify rel) {
+ if (rel.getOperation() != INSERT && rel.getOperation() != DELETE) {
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]