void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
void setSourceHint(SourceHint sourceHint, Command command) { if (sourceHint != null) { if (command instanceof SetQuery) { ((SetQuery)command).getProjectedQuery().setSourceHint(sourceHint); } else { command.setSourceHint(sourceHint); } } }
private void discoverWith( LinkedHashMap<String, WithQueryCommand> pushdownWith, Command command, List<WithQueryCommand> with, Collection<GroupSymbol> groups) throws QueryMetadataException, TeiidComponentException { for (GroupSymbol groupSymbol : groups) { if (!groupSymbol.isPushedCommonTable()) { continue; } WithQueryCommand clause = pushdownWith.get(groupSymbol.getNonCorrelationName()); if (clause == null) { continue; } TreeSet<GroupSymbol> temp = new TreeSet<GroupSymbol>(nonCorrelatedComparator); GroupCollectorVisitor.getGroupsIgnoreInlineViewsAndEvaluatableSubqueries(clause.getCommand(), temp); temp.removeAll(this.withGroups); discoverWith(pushdownWith, command, with, temp); with.add(clause.clone()); this.withGroups.add(clause.getGroupSymbol()); command.setSourceHint(SourceHint.combine(command.getSourceHint(), clause.getCommand().getSourceHint())); } }
private void discoverWith( LinkedHashMap<String, WithQueryCommand> pushdownWith, Command command, List<WithQueryCommand> with, Collection<GroupSymbol> groups) throws QueryMetadataException, TeiidComponentException { for (GroupSymbol groupSymbol : groups) { if (!groupSymbol.isPushedCommonTable()) { continue; } WithQueryCommand clause = pushdownWith.get(groupSymbol.getNonCorrelationName()); if (clause == null) { continue; } TreeSet<GroupSymbol> temp = new TreeSet<GroupSymbol>(nonCorrelatedComparator); GroupCollectorVisitor.getGroupsIgnoreInlineViewsAndEvaluatableSubqueries(clause.getCommand(), temp); temp.removeAll(this.withGroups); discoverWith(pushdownWith, command, with, temp); with.add(clause.clone()); this.withGroups.add(clause.getGroupSymbol()); command.setSourceHint(SourceHint.combine(command.getSourceHint(), clause.getCommand().getSourceHint())); } }
private void discoverWith( LinkedHashMap<String, WithQueryCommand> pushdownWith, Command command, List<WithQueryCommand> with, Collection<GroupSymbol> groups) throws QueryMetadataException, TeiidComponentException { for (GroupSymbol groupSymbol : groups) { if (!groupSymbol.isPushedCommonTable()) { continue; } WithQueryCommand clause = pushdownWith.get(groupSymbol.getNonCorrelationName()); if (clause == null) { continue; } TreeSet<GroupSymbol> temp = new TreeSet<GroupSymbol>(nonCorrelatedComparator); GroupCollectorVisitor.getGroupsIgnoreInlineViewsAndEvaluatableSubqueries(clause.getCommand(), temp); temp.removeAll(this.withGroups); discoverWith(pushdownWith, command, with, temp); with.add(clause.clone()); this.withGroups.add(clause.getGroupSymbol()); command.setSourceHint(SourceHint.combine(command.getSourceHint(), clause.getCommand().getSourceHint())); } }
@Test public void testSourcHints() throws Exception { Command command = helpGetCommand("update bqt1.smalla set stringkey = 1 where stringkey = 2", EXAMPLE_BQT); //$NON-NLS-1$ command.setSourceHint(new SourceHint()); AtomicRequestMessage arm = createNewAtomicRequestMessage(1, 1); arm.setCommand(command); ConnectorManager cm = TestConnectorManager.getConnectorManager(); cm.registerRequest(arm); }