private void validateSubquery(SubqueryContainer<?> subQuery) { if (subQuery.getCommand() instanceof Query && ((Query)subQuery.getCommand()).getInto() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.subquery_insert"), subQuery.getCommand()); //$NON-NLS-1$ } }
private void validateSubquery(SubqueryContainer<?> subQuery) { if (subQuery.getCommand() instanceof Query && ((Query)subQuery.getCommand()).getInto() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.subquery_insert"), subQuery.getCommand()); //$NON-NLS-1$ } }
private void validateSubquery(SubqueryContainer<?> subQuery) { if (subQuery.getCommand() instanceof Query && ((Query)subQuery.getCommand()).getInto() != null) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.subquery_insert"), subQuery.getCommand()); //$NON-NLS-1$ } }
/** * @param removeOrderBy * @param assStmt * @throws QueryValidatorException */ private void rewriteSubqueryContainer(SubqueryContainer container, boolean removeOrderBy) throws TeiidComponentException, TeiidProcessingException{ if (rewriteSubcommands && container.getCommand() != null && (container.getCommand().getProcessorPlan() == null || processing)) { container.setCommand(rewriteCommand(container.getCommand(), removeOrderBy)); } }
/** * @param removeOrderBy * @param assStmt * @throws QueryValidatorException */ private void rewriteSubqueryContainer(SubqueryContainer container, boolean removeOrderBy) throws TeiidComponentException, TeiidProcessingException{ if (rewriteSubcommands && container.getCommand() != null && (container.getCommand().getProcessorPlan() == null || processing)) { container.setCommand(rewriteCommand(container.getCommand(), removeOrderBy)); } }
/** * @param removeOrderBy * @param assStmt * @throws QueryValidatorException */ private void rewriteSubqueryContainer(SubqueryContainer container, boolean removeOrderBy) throws TeiidComponentException, TeiidProcessingException{ if (rewriteSubcommands && container.getCommand() != null && (container.getCommand().getProcessorPlan() == null || processing)) { container.setCommand(rewriteCommand(container.getCommand(), removeOrderBy)); } }
public static void resolveSubqueries(Command command, TempMetadataAdapter metadata, Collection<GroupSymbol> externalGroups) throws QueryResolverException, TeiidComponentException { for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(command)) { QueryResolver.setChildMetadata(container.getCommand(), command); if (externalGroups != null) { container.getCommand().pushNewResolvingContext(externalGroups); } QueryResolver.resolveCommand(container.getCommand(), metadata.getMetadata(), false); } }
public static void resolveSubqueries(Command command, TempMetadataAdapter metadata, Collection<GroupSymbol> externalGroups) throws QueryResolverException, TeiidComponentException { for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(command)) { QueryResolver.setChildMetadata(container.getCommand(), command); if (externalGroups != null) { container.getCommand().pushNewResolvingContext(externalGroups); } QueryResolver.resolveCommand(container.getCommand(), metadata.getMetadata(), false); } }
public static void resolveSubqueries(Command command, TempMetadataAdapter metadata, Collection<GroupSymbol> externalGroups) throws QueryResolverException, TeiidComponentException { for (SubqueryContainer container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(command)) { QueryResolver.setChildMetadata(container.getCommand(), command); if (externalGroups != null) { container.getCommand().pushNewResolvingContext(externalGroups); } QueryResolver.resolveCommand(container.getCommand(), metadata.getMetadata(), false); } }
public static Boolean requiresTransaction(boolean transactionalReads, List<SubqueryContainer<?>> valueIteratorProviders) { for (SubqueryContainer<?> subquery : valueIteratorProviders) { ProcessorPlan plan = subquery.getCommand().getProcessorPlan(); if (plan != null) { Boolean txn = plan.requiresTransaction(transactionalReads); if (txn == null || txn) { return true; //we can't ensure that this is read only } } } return false; }
public static Boolean requiresTransaction(boolean transactionalReads, List<SubqueryContainer<?>> valueIteratorProviders) { for (SubqueryContainer<?> subquery : valueIteratorProviders) { ProcessorPlan plan = subquery.getCommand().getProcessorPlan(); if (plan != null) { Boolean txn = plan.requiresTransaction(transactionalReads); if (txn == null || txn) { return true; //we can't ensure that this is read only } } } return false; }
public static Boolean requiresTransaction(boolean transactionalReads, List<SubqueryContainer<?>> valueIteratorProviders) { for (SubqueryContainer<?> subquery : valueIteratorProviders) { ProcessorPlan plan = subquery.getCommand().getProcessorPlan(); if (plan != null) { Boolean txn = plan.requiresTransaction(transactionalReads); if (txn == null || txn) { return true; //we can't ensure that this is read only } } } return false; }
private void collectEvaluatable(ArrayList<SubqueryContainer<?>> list, Command cmd) { for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(cmd)) { if (container instanceof Evaluatable<?> && ((Evaluatable<?>)container).shouldEvaluate()) { list.add(container); } else { collectEvaluatable(list, container.getCommand()); } } }
private void collectEvaluatable(ArrayList<SubqueryContainer<?>> list, Command cmd) { for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(cmd)) { if (container instanceof Evaluatable<?> && ((Evaluatable<?>)container).shouldEvaluate()) { list.add(container); } else { collectEvaluatable(list, container.getCommand()); } } }
private void collectEvaluatable(ArrayList<SubqueryContainer<?>> list, Command cmd) { for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(cmd)) { if (container instanceof Evaluatable<?> && ((Evaluatable<?>)container).shouldEvaluate()) { list.add(container); } else { collectEvaluatable(list, container.getCommand()); } } }
private void replaceExpressions(LanguageObject lo, Map<Expression, ElementSymbol> mapping, Map<Expression, Expression> subMapping) { if (lo == null) { return; } ExpressionMappingVisitor.mapExpressions(lo, mapping); if (subMapping != null) { //support only 1 level of correlation for (SubqueryContainer<?> container : ValueIteratorProviderCollectorVisitor.getValueIteratorProviders(lo)) { ExpressionMappingVisitor.mapExpressions(container.getCommand(), subMapping); } } }
private void setCorrelatedReferences(SubqueryContainer<?> container, List<Reference> correlatedReferences) { if (!correlatedReferences.isEmpty()) { SymbolMap map = new SymbolMap(); for (Reference reference : correlatedReferences) { map.addMapping(reference.getExpression(), reference.getExpression()); } container.getCommand().setCorrelatedReferences(map); } }
private void setCorrelatedReferences(SubqueryContainer<?> container, List<Reference> correlatedReferences) { if (!correlatedReferences.isEmpty()) { SymbolMap map = new SymbolMap(); for (Reference reference : correlatedReferences) { map.addMapping(reference.getExpression(), reference.getExpression()); } container.getCommand().setCorrelatedReferences(map); } }
private void setCorrelatedReferences(SubqueryContainer<?> container, List<Reference> correlatedReferences) { if (!correlatedReferences.isEmpty()) { SymbolMap map = new SymbolMap(); for (Reference reference : correlatedReferences) { map.addMapping(reference.getExpression(), reference.getExpression()); } container.getCommand().setCorrelatedReferences(map); } }
private void resolveSubQuery(SubqueryContainer<?> obj, Collection<GroupSymbol> externalGroups) { Command command = obj.getCommand(); QueryResolver.setChildMetadata(command, query); command.pushNewResolvingContext(externalGroups); try { QueryResolver.resolveCommand(command, metadata.getMetadata(), false); } catch (TeiidException err) { throw new TeiidRuntimeException(err); } }