diff --git a/src/main/java/se/liu/ida/hefquin/engine/queryplan/utils/PhysicalPlanFactory.java b/src/main/java/se/liu/ida/hefquin/engine/queryplan/utils/PhysicalPlanFactory.java index 5ba4e02ce..7b5a0226a 100644 --- a/src/main/java/se/liu/ida/hefquin/engine/queryplan/utils/PhysicalPlanFactory.java +++ b/src/main/java/se/liu/ida/hefquin/engine/queryplan/utils/PhysicalPlanFactory.java @@ -746,18 +746,20 @@ public static boolean checkUnaryOpApplicableToUnionPlan( final PhysicalPlan unio } if ( subRootOp instanceof PhysicalOpLocalToGlobal ){ - if ( !( subPlan.getSubPlan(0) instanceof PhysicalOpRequest || subPlan.getSubPlan(0) instanceof PhysicalOpFilter) ){ + final PhysicalPlan subSubPlan = subPlan.getSubPlan(0); + final PhysicalOperator subSubRootOp = subSubPlan.getRootOperator(); + if ( !( subSubRootOp instanceof PhysicalOpRequest || subSubRootOp instanceof PhysicalOpFilter) ){ return false; } - if ( subPlan.getSubPlan(0) instanceof PhysicalOpFilter ){ - if ( !( subPlan.getSubPlan(0).getSubPlan(0) instanceof PhysicalOpRequest) ){ + if ( subSubRootOp instanceof PhysicalOpFilter ){ + if ( !( subSubPlan.getSubPlan(0).getRootOperator() instanceof PhysicalOpRequest) ){ return false; } } } if ( subRootOp instanceof PhysicalOpFilter ){ - if ( !( subPlan.getSubPlan(0) instanceof PhysicalOpRequest) ){ + if ( !( subPlan.getSubPlan(0).getRootOperator() instanceof PhysicalOpRequest) ){ return false; } }