@Override public void visit(WithQueryCommand obj) { preVisitVisitor(obj); visitNodes(obj.getColumns()); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof WithQueryCommand)) { return false; } WithQueryCommand other = (WithQueryCommand)obj; return EquivalenceUtil.areEqual(groupSymbol, other.getGroupSymbol()) && EquivalenceUtil.areEqual(this.columns, other.getColumns()) && EquivalenceUtil.areEqual(this.queryExpression, other.queryExpression) && noInline == other.noInline && materialize == other.materialize && recursive == other.recursive; }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof WithQueryCommand)) { return false; } WithQueryCommand other = (WithQueryCommand)obj; return EquivalenceUtil.areEqual(groupSymbol, other.getGroupSymbol()) && EquivalenceUtil.areEqual(this.columns, other.getColumns()) && EquivalenceUtil.areEqual(this.queryExpression, other.queryExpression) && noInline == other.noInline && materialize == other.materialize && recursive == other.recursive; }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof WithQueryCommand)) { return false; } WithQueryCommand other = (WithQueryCommand)obj; return EquivalenceUtil.areEqual(groupSymbol, other.getGroupSymbol()) && EquivalenceUtil.areEqual(this.columns, other.getColumns()) && EquivalenceUtil.areEqual(this.queryExpression, other.queryExpression) && noInline == other.noInline && materialize == other.materialize && recursive == other.recursive; }
@Override public void visit(WithQueryCommand obj) { preVisitVisitor(obj); visitNodes(obj.getColumns()); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); }
@Override public void visit(WithQueryCommand obj) { preVisitVisitor(obj); visitNodes(obj.getColumns()); if (deep) { visitNode(obj.getCommand()); } postVisitVisitor(obj); }
if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { if (obj.getColumns().size() != projectedSymbols.size()) { throw new QueryResolverException(QueryPlugin.Event.TEIID30102, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30102, obj.getGroupSymbol())); Iterator<ElementSymbol> iter = obj.getColumns().iterator(); for (Expression singleElementSymbol : projectedSymbols) { ElementSymbol es = iter.next(); es.setType(singleElementSymbol.getType()); projectedSymbols = obj.getColumns(); obj.getGroupSymbol().setIsTempTable(true); List<GroupSymbol> groups = Collections.singletonList(obj.getGroupSymbol()); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { for (Expression singleElementSymbol : projectedSymbols) { ResolverVisitor.resolveLanguageObject(singleElementSymbol, groups, metadata); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { Iterator<ElementSymbol> iter = obj.getColumns().iterator(); for (TempMetadataID colid : id.getElements()) { ElementSymbol es = iter.next();
if (withQueryCommand.getColumns() != null) { List<ColumnReference> translatedElements = new ArrayList<ColumnReference>(withQueryCommand.getColumns().size()); for (ElementSymbol es: withQueryCommand.getColumns()) { ColumnReference cr = translate(es); translatedElements.add(cr);
if (withQueryCommand.getColumns() != null) { List<ColumnReference> translatedElements = new ArrayList<ColumnReference>(withQueryCommand.getColumns().size()); for (ElementSymbol es: withQueryCommand.getColumns()) { ColumnReference cr = translate(es); translatedElements.add(cr);
if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { if (obj.getColumns().size() != projectedSymbols.size()) { throw new QueryResolverException(QueryPlugin.Event.TEIID30102, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30102, obj.getGroupSymbol())); Iterator<ElementSymbol> iter = obj.getColumns().iterator(); for (Expression singleElementSymbol : projectedSymbols) { ElementSymbol es = iter.next(); es.setType(singleElementSymbol.getType()); projectedSymbols = obj.getColumns(); obj.getGroupSymbol().setIsTempTable(true); List<GroupSymbol> groups = Collections.singletonList(obj.getGroupSymbol()); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { for (Expression singleElementSymbol : projectedSymbols) { ResolverVisitor.resolveLanguageObject(singleElementSymbol, groups, metadata); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { Iterator<ElementSymbol> iter = obj.getColumns().iterator(); for (TempMetadataID colid : id.getElements()) { ElementSymbol es = iter.next();
if (withQueryCommand.getColumns() != null) { List<ColumnReference> translatedElements = new ArrayList<ColumnReference>(withQueryCommand.getColumns().size()); for (ElementSymbol es: withQueryCommand.getColumns()) { ColumnReference cr = translate(es); translatedElements.add(cr);
private boolean isPushdownValid(WithQueryCommand with, SetQuery setQuery, Object modelID, QueryCommand withCommand, RelationalPlan subPlan1) throws QueryMetadataException, TeiidComponentException { AccessNode aNode1 = CriteriaCapabilityValidatorVisitor.getAccessNode(subPlan1); if (aNode1 == null) { return false; } Object modelID1 = CriteriaCapabilityValidatorVisitor.validateCommandPushdown(null, metadata, capFinder, aNode1, false); QueryCommand withCommand1 = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode1); if (modelID1 == null || withCommand1 == null) { return false; } //if we are the same connector for each, then we should be good to proceed if (CapabilitiesUtil.isSameConnector(modelID, modelID1, metadata, capFinder)) { SetQuery pushdownSetQuery = new SetQuery(Operation.UNION, setQuery.isAll(), withCommand, withCommand1); WithQueryCommand wqc = new WithQueryCommand(with.getGroupSymbol(), with.getColumns(), pushdownSetQuery); wqc.setRecursive(true); this.withPlanningState.pushdownWith.put(with.getGroupSymbol().getName(), wqc); return true; } return false; }
private boolean isPushdownValid(WithQueryCommand with, SetQuery setQuery, Object modelID, QueryCommand withCommand, RelationalPlan subPlan1) throws QueryMetadataException, TeiidComponentException { AccessNode aNode1 = CriteriaCapabilityValidatorVisitor.getAccessNode(subPlan1); if (aNode1 == null) { return false; } Object modelID1 = CriteriaCapabilityValidatorVisitor.validateCommandPushdown(null, metadata, capFinder, aNode1, false); QueryCommand withCommand1 = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode1); if (modelID1 == null || withCommand1 == null) { return false; } //if we are the same connector for each, then we should be good to proceed if (CapabilitiesUtil.isSameConnector(modelID, modelID1, metadata, capFinder)) { SetQuery pushdownSetQuery = new SetQuery(Operation.UNION, setQuery.isAll(), withCommand, withCommand1); WithQueryCommand wqc = new WithQueryCommand(with.getGroupSymbol(), with.getColumns(), pushdownSetQuery); wqc.setRecursive(true); this.withPlanningState.pushdownWith.put(with.getGroupSymbol().getName(), wqc); return true; } return false; }
private boolean isPushdownValid(WithQueryCommand with, SetQuery setQuery, Object modelID, QueryCommand withCommand, RelationalPlan subPlan1) throws QueryMetadataException, TeiidComponentException { AccessNode aNode1 = CriteriaCapabilityValidatorVisitor.getAccessNode(subPlan1); if (aNode1 == null) { return false; } Object modelID1 = CriteriaCapabilityValidatorVisitor.validateCommandPushdown(null, metadata, capFinder, aNode1, false); QueryCommand withCommand1 = CriteriaCapabilityValidatorVisitor.getQueryCommand(aNode1); if (modelID1 == null || withCommand1 == null) { return false; } //if we are the same connector for each, then we should be good to proceed if (CapabilitiesUtil.isSameConnector(modelID, modelID1, metadata, capFinder)) { SetQuery pushdownSetQuery = new SetQuery(Operation.UNION, setQuery.isAll(), withCommand, withCommand1); WithQueryCommand wqc = new WithQueryCommand(with.getGroupSymbol(), with.getColumns(), pushdownSetQuery); wqc.setRecursive(true); this.withPlanningState.pushdownWith.put(with.getGroupSymbol().getName(), wqc); return true; } return false; }
@Override public void open() throws TeiidComponentException, TeiidProcessingException { if (with != null && tempTableStore.getProcessors() == null) { HashMap<String, TableProcessor> processors = new HashMap<String, TableProcessor>(); tempTableStore.setProcessors(processors); for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); ProcessorPlan initial = setQuery.getLeftQuery().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(initial, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new RecursiveTableProcessor(withProcessor, withCommand.getColumns(), setQuery.getRightQuery().getProcessorPlan(), setQuery.isAll())); continue; } ProcessorPlan plan = withCommand.getCommand().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(plan, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new TableProcessor(withProcessor, withCommand.getColumns())); } } this.root.open(); }
@Override public void open() throws TeiidComponentException, TeiidProcessingException { if (with != null && tempTableStore.getProcessors() == null) { HashMap<String, TableProcessor> processors = new HashMap<String, TableProcessor>(); tempTableStore.setProcessors(processors); for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); ProcessorPlan initial = setQuery.getLeftQuery().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(initial, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new RecursiveTableProcessor(withProcessor, withCommand.getColumns(), setQuery.getRightQuery().getProcessorPlan(), setQuery.isAll())); continue; } ProcessorPlan plan = withCommand.getCommand().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(plan, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new TableProcessor(withProcessor, withCommand.getColumns())); } } this.root.open(); }
@Override public void open() throws TeiidComponentException, TeiidProcessingException { if (with != null && tempTableStore.getProcessors() == null) { HashMap<String, TableProcessor> processors = new HashMap<String, TableProcessor>(); tempTableStore.setProcessors(processors); for (WithQueryCommand withCommand : this.with) { if (withCommand.isRecursive()) { SetQuery setQuery = (SetQuery)withCommand.getCommand(); ProcessorPlan initial = setQuery.getLeftQuery().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(initial, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new RecursiveTableProcessor(withProcessor, withCommand.getColumns(), setQuery.getRightQuery().getProcessorPlan(), setQuery.isAll())); continue; } ProcessorPlan plan = withCommand.getCommand().getProcessorPlan(); QueryProcessor withProcessor = new QueryProcessor(plan, getContext().clone(), root.getBufferManager(), root.getDataManager()); processors.put(withCommand.getGroupSymbol().getName(), new TableProcessor(withProcessor, withCommand.getColumns())); } } this.root.open(); }
visitNode(obj.getGroupSymbol()); append(SPACE); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { append(Tokens.LPAREN); shortNameOnly = true; registerNodes(obj.getColumns(), 0); shortNameOnly = false; append(Tokens.RPAREN);
visitNode(obj.getGroupSymbol()); append(SPACE); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { append(Tokens.LPAREN); shortNameOnly = true; registerNodes(obj.getColumns(), 0); shortNameOnly = false; append(Tokens.RPAREN);
visitNode(obj.getGroupSymbol()); append(SPACE); if (obj.getColumns() != null && !obj.getColumns().isEmpty()) { append(Tokens.LPAREN); shortNameOnly = true; registerNodes(obj.getColumns(), 0); shortNameOnly = false; append(Tokens.RPAREN);