Boolean pushAcrossFrame(PlanNode sourceNode, PlanNode critNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { //ensure that the criteria can be pushed further if (sourceNode.getChildCount() == 1 && FrameUtil.isOrderedOrStrictLimit(sourceNode.getFirstChild())) { return false; } //check to see if this is a move across a union if (sourceNode.getChildCount() > 0) { PlanNode child = sourceNode.getFirstChild(); child = FrameUtil.findOriginatingNode(child, child.getGroups()); if (child != null && child.getType() == NodeConstants.Types.SET_OP) { //only allow criteria without subqueires - node cloning doesn't allow for the proper creation of //multiple nodes with the same subqueries if (child == sourceNode.getFirstChild() && critNode.getSubqueryContainers().isEmpty()) { return pushAcrossSetOp(critNode, child, metadata, capFinder, context); } //this could be an access node in the middle of the source and set op, //it is an odd case that is not supported for now return false; } } // See if we can move it towards the SOURCE node return moveNodeAcrossFrame(critNode, sourceNode, metadata); }
Boolean pushAcrossFrame(PlanNode sourceNode, PlanNode critNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { //ensure that the criteria can be pushed further if (sourceNode.getChildCount() == 1 && FrameUtil.isOrderedOrStrictLimit(sourceNode.getFirstChild())) { return false; } //check to see if this is a move across a union if (sourceNode.getChildCount() > 0) { PlanNode child = sourceNode.getFirstChild(); child = FrameUtil.findOriginatingNode(child, child.getGroups()); if (child != null && child.getType() == NodeConstants.Types.SET_OP) { //only allow criteria without subqueires - node cloning doesn't allow for the proper creation of //multiple nodes with the same subqueries if (child == sourceNode.getFirstChild() && critNode.getSubqueryContainers().isEmpty()) { return pushAcrossSetOp(critNode, child, metadata, capFinder, context); } //this could be an access node in the middle of the source and set op, //it is an odd case that is not supported for now return false; } } // See if we can move it towards the SOURCE node return moveNodeAcrossFrame(critNode, sourceNode, metadata); }
Boolean pushAcrossFrame(PlanNode sourceNode, PlanNode critNode, QueryMetadataInterface metadata, CapabilitiesFinder capFinder, CommandContext context) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { //ensure that the criteria can be pushed further if (sourceNode.getChildCount() == 1 && FrameUtil.isOrderedOrStrictLimit(sourceNode.getFirstChild())) { return false; } //check to see if this is a move across a union if (sourceNode.getChildCount() > 0) { PlanNode child = sourceNode.getFirstChild(); child = FrameUtil.findOriginatingNode(child, child.getGroups()); if (child != null && child.getType() == NodeConstants.Types.SET_OP) { //only allow criteria without subqueires - node cloning doesn't allow for the proper creation of //multiple nodes with the same subqueries if (child == sourceNode.getFirstChild() && critNode.getSubqueryContainers().isEmpty()) { return pushAcrossSetOp(critNode, child, metadata, capFinder, context); } //this could be an access node in the middle of the source and set op, //it is an odd case that is not supported for now return false; } } // See if we can move it towards the SOURCE node return moveNodeAcrossFrame(critNode, sourceNode, metadata); }