public List<SymbolMap> getCorrelatedReferences() { List<SubqueryContainer<?>> containers = getSubqueryContainers(); if (containers.isEmpty()) { return Collections.emptyList(); } ArrayList<SymbolMap> result = new ArrayList<SymbolMap>(containers.size()); for (SubqueryContainer<?> container : containers) { SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { result.add(map); } } return result; }
public List<SymbolMap> getCorrelatedReferences() { List<SubqueryContainer<?>> containers = getSubqueryContainers(); if (containers.isEmpty()) { return Collections.emptyList(); } ArrayList<SymbolMap> result = new ArrayList<SymbolMap>(containers.size()); for (SubqueryContainer<?> container : containers) { SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { result.add(map); } } return result; }
public List<SymbolMap> getCorrelatedReferences() { List<SubqueryContainer<?>> containers = getSubqueryContainers(); if (containers.isEmpty()) { return Collections.emptyList(); } ArrayList<SymbolMap> result = new ArrayList<SymbolMap>(containers.size()); for (SubqueryContainer<?> container : containers) { SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { result.add(map); } } return result; }
private Object getSubqueryModelId(QueryMetadataInterface metadata, CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record) throws TeiidComponentException, QueryMetadataException { Object modelId = null; for (SubqueryContainer subqueryContainer : critNode.getSubqueryContainers()) { Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder, record); if (validId == null) { return null; } if (modelId == null) { modelId = validId; } else if (!CapabilitiesUtil.isSameConnector(modelId, validId, metadata, capFinder)) { return null; } } return modelId; }
private Object getSubqueryModelId(QueryMetadataInterface metadata, CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record) throws TeiidComponentException, QueryMetadataException { Object modelId = null; for (SubqueryContainer subqueryContainer : critNode.getSubqueryContainers()) { Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder, record); if (validId == null) { return null; } if (modelId == null) { modelId = validId; } else if (!CapabilitiesUtil.isSameConnector(modelId, validId, metadata, capFinder)) { return null; } } return modelId; }
private Object getSubqueryModelId(QueryMetadataInterface metadata, CapabilitiesFinder capFinder, PlanNode critNode, AnalysisRecord record) throws TeiidComponentException, QueryMetadataException { Object modelId = null; for (SubqueryContainer subqueryContainer : critNode.getSubqueryContainers()) { Object validId = CriteriaCapabilityValidatorVisitor.validateSubqueryPushdown(subqueryContainer, null, metadata, capFinder, record); if (validId == null) { return null; } if (modelId == null) { modelId = validId; } else if (!CapabilitiesUtil.isSameConnector(modelId, validId, metadata, capFinder)) { return null; } } return modelId; }
private void visitSelectNode(PlanNode node, Set<Criteria> toCopy, Set<Criteria> allCriteria) { //First examine criteria in critNode for suitability Criteria crit = (Criteria) node.getProperty(NodeConstants.Info.SELECT_CRITERIA); if(node.getGroups().size() == 1) { List<Criteria> crits = Criteria.separateCriteriaByAnd(crit); if(!node.hasBooleanProperty(NodeConstants.Info.IS_HAVING) && node.getSubqueryContainers().isEmpty()) { if (!node.hasBooleanProperty(NodeConstants.Info.IS_COPIED)) { toCopy.addAll(crits); } allCriteria.addAll(crits); } } }
private void visitSelectNode(PlanNode node, Set<Criteria> toCopy, Set<Criteria> allCriteria) { //First examine criteria in critNode for suitability Criteria crit = (Criteria) node.getProperty(NodeConstants.Info.SELECT_CRITERIA); if(node.getGroups().size() == 1) { List<Criteria> crits = Criteria.separateCriteriaByAnd(crit); if(!node.hasBooleanProperty(NodeConstants.Info.IS_HAVING) && node.getSubqueryContainers().isEmpty()) { if (!node.hasBooleanProperty(NodeConstants.Info.IS_COPIED)) { toCopy.addAll(crits); } allCriteria.addAll(crits); } } }
private void visitSelectNode(PlanNode node, Set<Criteria> toCopy, Set<Criteria> allCriteria) { //First examine criteria in critNode for suitability Criteria crit = (Criteria) node.getProperty(NodeConstants.Info.SELECT_CRITERIA); if(node.getGroups().size() == 1) { List<Criteria> crits = Criteria.separateCriteriaByAnd(crit); if(!node.hasBooleanProperty(NodeConstants.Info.IS_HAVING) && node.getSubqueryContainers().isEmpty()) { if (!node.hasBooleanProperty(NodeConstants.Info.IS_COPIED)) { toCopy.addAll(crits); } allCriteria.addAll(crits); } } }
for (SubqueryContainer<?> container : parentNode.getSubqueryContainers()) { if (container instanceof ExistsCriteria && ((ExistsCriteria) container).shouldEvaluate()) { continue;
for (SubqueryContainer<?> container : parentNode.getSubqueryContainers()) { if (container instanceof ExistsCriteria && ((ExistsCriteria) container).shouldEvaluate()) { continue;
for (SubqueryContainer<?> container : parentNode.getSubqueryContainers()) { if (container instanceof ExistsCriteria && ((ExistsCriteria) container).shouldEvaluate()) { continue;
private void connectSubqueryContainers(PlanNode plan) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { for (PlanNode node : NodeEditor.findAllNodes(plan, NodeConstants.Types.PROJECT | NodeConstants.Types.SELECT | NodeConstants.Types.JOIN | NodeConstants.Types.SOURCE | NodeConstants.Types.GROUP | NodeConstants.Types.SORT)) { Set<GroupSymbol> groupSymbols = getGroupSymbols(node); List<SubqueryContainer<?>> subqueryContainers = node.getSubqueryContainers(); planSubqueries(groupSymbols, node, subqueryContainers, false); node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements())); } }
private void connectSubqueryContainers(PlanNode plan, boolean skipPlanning) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { for (PlanNode node : getAllPossibleSubqueryNodes(plan)) { Set<GroupSymbol> groupSymbols = getGroupSymbols(node); List<SubqueryContainer<?>> subqueryContainers = node.getSubqueryContainers(); planSubqueries(groupSymbols, node, subqueryContainers, false, skipPlanning); node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements())); } }
private void connectSubqueryContainers(PlanNode plan, boolean skipPlanning) throws QueryPlannerException, QueryMetadataException, TeiidComponentException { for (PlanNode node : getAllPossibleSubqueryNodes(plan)) { Set<GroupSymbol> groupSymbols = getGroupSymbols(node); List<SubqueryContainer<?>> subqueryContainers = node.getSubqueryContainers(); planSubqueries(groupSymbols, node, subqueryContainers, false, skipPlanning); node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements())); } }
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); }
if (!critNode.getSubqueryContainers().isEmpty() && checkConversion(symbolMap, critNode.getCorrelatedReferenceElements()) != null) { return null; //not convertable, or has an aggregate for a correlated reference
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); }
if (!critNode.getSubqueryContainers().isEmpty() && checkConversion(symbolMap, critNode.getCorrelatedReferenceElements()) != null) { return null; //not convertable, or has an aggregate for a correlated reference