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; }
if (subquery.getCommand().getProcessorPlan() instanceof RelationalPlan) { assignWithClause(((RelationalPlan)subquery.getCommand().getProcessorPlan()).getRootNode(), pushdownWith, repeated | (subquery.getCommand().getCorrelatedReferences() != null && !subquery.getCommand().getCorrelatedReferences().asMap().isEmpty()));
if (grouping != null) { SymbolMap map = (SymbolMap) grouping.getProperty(Info.SYMBOL_MAP); SymbolMap symbolMap = container.getCommand().getCorrelatedReferences(); for (Map.Entry<ElementSymbol, Expression> entry : map.asMap().entrySet()) { if (!(entry.getValue() instanceof ElementSymbol)) {
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
/** * Checks to see if the object is non-deterministic * iff all function are non-deterministic, and all correlated subqueries are deterministic * @param ex * @return */ public static boolean isNonDeterministic(LanguageObject ex) { Collection<Function> functions = FunctionCollectorVisitor.getFunctions(ex, true, false); for (Function function : functions) { if ( function.getFunctionDescriptor().getDeterministic() == Determinism.NONDETERMINISTIC) { return true; } } for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(ex)) { if (container.getCommand().getCorrelatedReferences() != null && isNonDeterministic(container.getCommand())) { return true; } } return false; }
if (grouping != null) { SymbolMap map = (SymbolMap) grouping.getProperty(Info.SYMBOL_MAP); SymbolMap symbolMap = container.getCommand().getCorrelatedReferences(); for (Map.Entry<ElementSymbol, Expression> entry : map.asMap().entrySet()) { if (!(entry.getValue() instanceof ElementSymbol)) {
if (grouping != null) { SymbolMap map = (SymbolMap) grouping.getProperty(Info.SYMBOL_MAP); SymbolMap symbolMap = container.getCommand().getCorrelatedReferences(); for (Map.Entry<ElementSymbol, Expression> entry : map.asMap().entrySet()) { if (!(entry.getValue() instanceof ElementSymbol)) {
public static void prepareSubquery(SubqueryContainer container) { RelationalPlan subqueryPlan = (RelationalPlan)container.getCommand().getProcessorPlan(); AccessNode aNode = CriteriaCapabilityValidatorVisitor.getAccessNode(subqueryPlan); QueryCommand command = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode); if (command == null) { return; } final SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { ExpressionMappingVisitor visitor = new RuleMergeCriteria.ReferenceReplacementVisitor(map); DeepPostOrderNavigator.doVisit(command, visitor); } command.setProcessorPlan(container.getCommand().getProcessorPlan()); boolean removeLimit = false; if (container instanceof ExistsCriteria) { removeLimit = !((ExistsCriteria)container).shouldEvaluate(); } else if (container instanceof ScalarSubquery) { removeLimit = !((ScalarSubquery)container).shouldEvaluate(); } if (removeLimit && command.getLimit() != null && command.getLimit().isImplicit()) { command.setLimit(null); } container.setCommand(command); }
public static void prepareSubquery(SubqueryContainer container) { RelationalPlan subqueryPlan = (RelationalPlan)container.getCommand().getProcessorPlan(); AccessNode aNode = CriteriaCapabilityValidatorVisitor.getAccessNode(subqueryPlan); QueryCommand command = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode); if (command == null) { return; } final SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { ExpressionMappingVisitor visitor = new RulePlanSubqueries.ReferenceReplacementVisitor(map); DeepPostOrderNavigator.doVisit(command, visitor); } command.setProcessorPlan(container.getCommand().getProcessorPlan()); boolean removeLimit = false; if (container instanceof ExistsCriteria) { removeLimit = !((ExistsCriteria)container).shouldEvaluate(); } else if (container instanceof ScalarSubquery) { removeLimit = !((ScalarSubquery)container).shouldEvaluate(); } if (removeLimit && command.getLimit() != null && command.getLimit().isImplicit()) { command.setLimit(null); } container.setCommand(command); }
public static void prepareSubquery(SubqueryContainer container) { RelationalPlan subqueryPlan = (RelationalPlan)container.getCommand().getProcessorPlan(); AccessNode aNode = CriteriaCapabilityValidatorVisitor.getAccessNode(subqueryPlan); QueryCommand command = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode); if (command == null) { return; } final SymbolMap map = container.getCommand().getCorrelatedReferences(); if (map != null) { ExpressionMappingVisitor visitor = new RulePlanSubqueries.ReferenceReplacementVisitor(map); DeepPostOrderNavigator.doVisit(command, visitor); } command.setProcessorPlan(container.getCommand().getProcessorPlan()); boolean removeLimit = false; if (container instanceof ExistsCriteria) { removeLimit = !((ExistsCriteria)container).shouldEvaluate(); } else if (container instanceof ScalarSubquery) { removeLimit = !((ScalarSubquery)container).shouldEvaluate(); } if (removeLimit && command.getLimit() != null && command.getLimit().isImplicit()) { command.setLimit(null); } container.setCommand(command); }
SymbolMap refs = subqueryContainer.getCommand().getCorrelatedReferences(); try { if(refs != null && !refs.asMap().isEmpty()) {
SymbolMap refs = subqueryContainer.getCommand().getCorrelatedReferences(); try { if(refs != null && !refs.asMap().isEmpty()) {
SymbolMap refs = subqueryContainer.getCommand().getCorrelatedReferences(); try { if(refs != null && !refs.asMap().isEmpty()) {
if (subqueryContainer.getCommand().getCorrelatedReferences() != null) { continue;
if (subqueryContainer.getCommand().getCorrelatedReferences() == null) { if (subqueryContainer instanceof ScalarSubquery) { ((ScalarSubquery) subqueryContainer).setShouldEvaluate(true);
if (subqueryContainer.getCommand().getCorrelatedReferences() == null) { if (subqueryContainer instanceof ScalarSubquery) { ((ScalarSubquery) subqueryContainer).setShouldEvaluate(true);
if (subqueryContainer.getCommand().getCorrelatedReferences() == null) { if (subqueryContainer instanceof ScalarSubquery) { ((ScalarSubquery) subqueryContainer).setShouldEvaluate(true);