/** * Get temporary element ID based on group and element name parts * @param tempGroup Group name * @param tempElement Short element name * @return Metadata ID or null if not found */ public List<TempMetadataID> getTempElementElementIDs(String tempGroup) { TempMetadataID groupID = getTempGroupID(tempGroup); if(groupID != null) { return groupID.getElements(); } return null; }
@Override public TempMetadataID getGlobalTempTableMetadataId(String matTableName) { return this.tableStore.getMetadataStore().getTempGroupID(matTableName); }
@Override public TempMetadataID getGlobalTempTableMetadataId(String matTableName) { return this.tableStore.getMetadataStore().getTempGroupID(matTableName); }
/** * Get temporary element ID based on group and element name parts * @param tempGroup Group name * @param tempElement Short element name * @return Metadata ID or null if not found */ public List<TempMetadataID> getTempElementElementIDs(String tempGroup) { TempMetadataID groupID = getTempGroupID(tempGroup); if(groupID != null) { return groupID.getElements(); } return null; }
@Override public TempMetadataID getGlobalTempTableMetadataId(String matTableName) { return this.tableStore.getMetadataStore().getTempGroupID(matTableName); }
/** * Get temporary element ID based on group and element name parts * @param tempGroup Group name * @param tempElement Short element name * @return Metadata ID or null if not found */ public List<TempMetadataID> getTempElementElementIDs(String tempGroup) { TempMetadataID groupID = getTempGroupID(tempGroup); if(groupID != null) { return groupID.getElements(); } return null; }
public Object getGroupIDForElementID(Object elementID) throws TeiidComponentException, QueryMetadataException { if(elementID instanceof TempMetadataID) { String elementName = ((TempMetadataID)elementID).getID(); String groupName = elementName.substring(0, elementName.lastIndexOf(SEPARATOR)); return this.tempStore.getTempGroupID(groupName); } return this.actualMetadata.getGroupIDForElementID(elementID); }
public Object getGroupIDForElementID(Object elementID) throws TeiidComponentException, QueryMetadataException { if(elementID instanceof TempMetadataID) { String elementName = ((TempMetadataID)elementID).getID(); String groupName = elementName.substring(0, elementName.lastIndexOf(SEPARATOR)); return this.tempStore.getTempGroupID(groupName); } return this.actualMetadata.getGroupIDForElementID(elementID); }
public Object getGroupIDForElementID(Object elementID) throws TeiidComponentException, QueryMetadataException { if(elementID instanceof TempMetadataID) { String elementName = ((TempMetadataID)elementID).getID(); String groupName = elementName.substring(0, elementName.lastIndexOf(SEPARATOR)); return this.tempStore.getTempGroupID(groupName); } return this.actualMetadata.getGroupIDForElementID(elementID); }
private void isValidGroup(TempMetadataAdapter metadata, String groupName) throws QueryResolverException { if (metadata.getMetadataStore().getTempGroupID(groupName) != null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30124, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30124, groupName)); } //check - cursor name should not start with # if(GroupSymbol.isTempGroupName(groupName)){ throw new QueryResolverException(QueryPlugin.Event.TEIID30125, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30125, groupName)); } }
private void isValidGroup(TempMetadataAdapter metadata, String groupName) throws QueryResolverException { if (metadata.getMetadataStore().getTempGroupID(groupName) != null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30124, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30124, groupName)); } //check - cursor name should not start with # if(GroupSymbol.isTempGroupName(groupName)){ throw new QueryResolverException(QueryPlugin.Event.TEIID30125, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30125, groupName)); } }
void addForeignTempTable(final String tempTableName, Create create) { TempMetadataID id = tempMetadataStore.getTempGroupID(tempTableName); if (id == null) { id = tempMetadataStore.addTempGroup(tempTableName, create.getColumnSymbols(), false, true); id.setOriginalMetadataID(create.getTableMetadata()); id.getTableData().setModel(create.getTableMetadata().getParent()); } this.foreignTempTables.put(tempTableName, create.getTableMetadata()); }
private void isValidGroup(TempMetadataAdapter metadata, String groupName) throws QueryResolverException { if (metadata.getMetadataStore().getTempGroupID(groupName) != null) { throw new QueryResolverException(QueryPlugin.Event.TEIID30124, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30124, groupName)); } //check - cursor name should not start with # if(GroupSymbol.isTempGroupName(groupName)){ throw new QueryResolverException(QueryPlugin.Event.TEIID30125, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30125, groupName)); } }
void addForeignTempTable(final String tempTableName, Create create) { TempMetadataID id = tempMetadataStore.getTempGroupID(tempTableName); if (id == null) { id = tempMetadataStore.addTempGroup(tempTableName, create.getColumnSymbols(), false, true); id.setOriginalMetadataID(create.getTableMetadata()); id.getTableData().setModel(create.getTableMetadata().getParent()); } this.foreignTempTables.put(tempTableName, create.getTableMetadata()); }
/** * @see org.teiid.query.resolver.ProcedureContainerResolver#resolveGroup(org.teiid.query.metadata.TempMetadataAdapter, org.teiid.query.sql.lang.ProcedureContainer) */ protected void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand) throws TeiidComponentException, QueryResolverException { try { super.resolveGroup(metadata, procCommand); } catch (QueryResolverException e) { if (!procCommand.getGroup().isImplicitTempGroupSymbol() || metadata.getMetadataStore().getTempGroupID(procCommand.getGroup().getName()) != null) { throw e; } } }
/** * @see org.teiid.query.resolver.ProcedureContainerResolver#resolveGroup(org.teiid.query.metadata.TempMetadataAdapter, org.teiid.query.sql.lang.ProcedureContainer) */ protected void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand) throws TeiidComponentException, QueryResolverException { try { super.resolveGroup(metadata, procCommand); } catch (QueryResolverException e) { if (!procCommand.getGroup().isImplicitTempGroupSymbol() || metadata.getMetadataStore().getTempGroupID(procCommand.getGroup().getName()) != null) { throw e; } } }
/** * @see org.teiid.query.resolver.ProcedureContainerResolver#resolveGroup(org.teiid.query.metadata.TempMetadataAdapter, org.teiid.query.sql.lang.ProcedureContainer) */ protected void resolveGroup(TempMetadataAdapter metadata, ProcedureContainer procCommand) throws TeiidComponentException, QueryResolverException { try { super.resolveGroup(metadata, procCommand); } catch (QueryResolverException e) { if (!procCommand.getGroup().isImplicitTempGroupSymbol() || metadata.getMetadataStore().getTempGroupID(procCommand.getGroup().getName()) != null) { throw e; } } }
void addForeignTempTable(final String tempTableName, Create create) { TempMetadataID id = tempMetadataStore.getTempGroupID(tempTableName); if (id == null) { id = tempMetadataStore.addTempGroup(tempTableName, create.getColumnSymbols(), false, true); id.setOriginalMetadataID(create.getTableMetadata()); id.getTableData().setModel(create.getTableMetadata().getParent()); } this.foreignTempTables.put(tempTableName, create.getTableMetadata()); }
public void visit(SubqueryFromClause obj) { Collection<GroupSymbol> externalGroups = this.currentGroups; if (obj.isLateral() && allowImplicit) { externalGroups = new ArrayList<GroupSymbol>(externalGroups); externalGroups.addAll(this.implicitGroups); } resolveSubQuery(obj, externalGroups); discoveredGroup(obj.getGroupSymbol()); try { ResolverUtil.addTempGroup(metadata, obj.getGroupSymbol(), obj.getCommand().getProjectedSymbols(), false); } catch (QueryResolverException err) { throw new TeiidRuntimeException(err); } obj.getGroupSymbol().setMetadataID(metadata.getMetadataStore().getTempGroupID(obj.getGroupSymbol().getName())); }
public float getCardinality(Object groupID) throws TeiidComponentException, QueryMetadataException{ groupID = getActualMetadataId(groupID); if(groupID instanceof TempMetadataID) { return ((TempMetadataID)groupID).getCardinality(); } if (this.isSession() && groupID instanceof Table) { Table t = (Table)groupID; if (t.getTableType() == Table.Type.TemporaryTable && t.isVirtual()) { TempMetadataID id = this.tempStore.getTempGroupID(t.getName()); if (id != null) { return id.getCardinality(); } } } return this.actualMetadata.getCardinality(groupID); }