public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getGroupID(groupName); }
public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getGroupID(groupName); }
public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { return actualMetadata.getGroupID(groupName); }
@Override public Table getTable(String fullName) throws TranslatorException { try { Object groupId = metadata.getGroupID(fullName); return getGroup(groupId); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30466, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30467, e); } }
@Override public Table getTable(String fullName) throws TranslatorException { try { Object groupId = metadata.getGroupID(fullName); return getGroup(groupId); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30466, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30467, e); } }
@Override public Table getTable(String fullName) throws TranslatorException { try { Object groupId = metadata.getGroupID(fullName); return getGroup(groupId); } catch (QueryMetadataException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30466, e); } catch (TeiidComponentException e) { throw new TranslatorException(QueryPlugin.Event.TEIID30467, e); } }
public static void setCardinality(String group, int cardinality, QueryMetadataInterface metadata) throws QueryMetadataException, TeiidComponentException { if (metadata instanceof TransformationMetadata) { Table t = (Table)metadata.getGroupID(group); t.setCardinality(cardinality); } else { throw new RuntimeException("unknown metadata"); //$NON-NLS-1$ } }
if (stateId.startsWith(RelationalPlanner.MAT_PREFIX)) { String viewName = stateId.substring(RelationalPlanner.MAT_PREFIX.length()); Object viewId = this.metadata.getGroupID(viewName); group.setMetadataID(getGlobalTempTableMetadataId(viewId)); } else {
if (stateId.startsWith(RelationalPlanner.MAT_PREFIX)) { String viewName = stateId.substring(RelationalPlanner.MAT_PREFIX.length()); Object viewId = this.metadata.getGroupID(viewName); group.setMetadataID(getGlobalTempTableMetadataId(viewId)); } else {
/** * Check metadata first, then check temp groups if not found */ public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { Object tempID = null; try { tempID = this.actualMetadata.getGroupID(groupName); } catch (QueryMetadataException e) { //ignore } if (tempID == null){ tempID = this.tempStore.getTempGroupID(groupName); } if(tempID != null) { return tempID; } throw new QueryMetadataException(QueryPlugin.Event.TEIID30351, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30351, groupName)); }
/** * Check metadata first, then check temp groups if not found */ public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { Object tempID = null; try { tempID = this.actualMetadata.getGroupID(groupName); } catch (QueryMetadataException e) { //ignore } if (tempID == null){ tempID = this.tempStore.getTempGroupID(groupName); } if(tempID != null) { return tempID; } throw new QueryMetadataException(QueryPlugin.Event.TEIID30351, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30351, groupName)); }
/** * Check metadata first, then check temp groups if not found */ public Object getGroupID(String groupName) throws TeiidComponentException, QueryMetadataException { Object tempID = null; try { tempID = this.actualMetadata.getGroupID(groupName); } catch (QueryMetadataException e) { //ignore } if (tempID == null){ tempID = this.tempStore.getTempGroupID(groupName); } if(tempID != null) { return tempID; } throw new QueryMetadataException(QueryPlugin.Event.TEIID30351, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30351, groupName)); }
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
private Object validateMatView(QueryMetadataInterface metadata, String viewName) throws TeiidComponentException, TeiidProcessingException { try { Object groupID = metadata.getGroupID(viewName); if (!metadata.hasMaterialization(groupID) || metadata.getMaterialization(groupID) != null) { throw new QueryProcessingException(QueryPlugin.Event.TEIID30233, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30233, viewName)); } return groupID; } catch (QueryMetadataException e) { throw new TeiidProcessingException(QueryPlugin.Event.TEIID30234, e); } }
public void testGetContext() throws Exception { Object metadataID = TstLanguageBridgeFactory.metadata.getGroupID("pm1.g1"); //$NON-NLS-1$ assertEquals("x", example("x", "pm1.g1", metadataID).getCorrelationName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
public void testGetDefinition() throws Exception { Object metadataID = TstLanguageBridgeFactory.metadata.getGroupID("pm1.g1"); //$NON-NLS-1$ assertEquals("g1", example("x", "pm1.g1", metadataID).getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
public static Object getTrackableGroup(GroupSymbol group, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { Object metadataID = group.getMetadataID(); if (group.isTempGroupSymbol()) { QueryMetadataInterface qmi = metadata.getSessionMetadata(); try { //exclude proc scoped temp tables if (group.isGlobalTable()) { return metadataID; } if (qmi != null) { Object mid = qmi.getGroupID(group.getNonCorrelationName()); if (mid == metadataID || metadata.isVirtualGroup(metadataID)) { //global temp should use the session metadata reference instead return mid; } } } catch (QueryMetadataException e) { //not a session table } if (metadata.isVirtualGroup(metadataID)) { //global temp table return metadataID; } } else { return metadataID; } return null; }
public static Object getTrackableGroup(GroupSymbol group, QueryMetadataInterface metadata) throws TeiidComponentException, QueryMetadataException { Object metadataID = group.getMetadataID(); if (group.isTempGroupSymbol()) { QueryMetadataInterface qmi = metadata.getSessionMetadata(); try { //exclude proc scoped temp tables if (group.isGlobalTable()) { return metadataID; } if (qmi != null) { Object mid = qmi.getGroupID(group.getNonCorrelationName()); if (mid == metadataID || metadata.isVirtualGroup(metadataID)) { //global temp should use the session metadata reference instead return mid; } } } catch (QueryMetadataException e) { //not a session table } if (metadata.isVirtualGroup(metadataID)) { //global temp table return metadataID; } } else { return metadataID; } return null; }
/** * Tests that any access patterns (a Collection of Collections of * Object element ids) for a physical group will be found and added * as a property of an ACCESS node. */ public void testAddAccessPatterns2() throws Exception { Query query = new Query(); From from = new From(); GroupSymbol group = new GroupSymbol("pm4.g2"); //$NON-NLS-1$ from.addGroup(group); query.setFrom(from); Select select = new Select(); select.addSymbol(new MultipleElementSymbol()); query.setSelect(select); group.setMetadataID(METADATA.getGroupID("pm4.g2")); //$NON-NLS-1$ PlanNode n1 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS); n1.setProperty(NodeConstants.Info.ATOMIC_REQUEST, query); n1.addGroup(group); RulePlaceAccess.addAccessPatternsProperty(n1, METADATA); Collection accessPatterns = (Collection)n1.getProperty(NodeConstants.Info.ACCESS_PATTERNS); assertNotNull(accessPatterns); assertTrue("Expected two access patterns, got " + accessPatterns.size(), accessPatterns.size() == 2); //$NON-NLS-1$ }