/** * Checks if a group is in the From * @param group Group to check for * @return True if the From contains the group */ public boolean containsGroup( GroupSymbol group ) { return getGroups().contains(group); }
/** * Checks if a group is in the From * @param group Group to check for * @return True if the From contains the group */ public boolean containsGroup( GroupSymbol group ) { return getGroups().contains(group); }
/** * Checks if a group is in the From * @param group Group to check for * @return True if the From contains the group */ public boolean containsGroup( GroupSymbol group ) { return getGroups().contains(group); }
/** * Get hashcode for From. WARNING: The hash code relies on the variables * in the select, so changing the variables will change the hash code, causing * a select to be lost in a hash structure. Do not hash a From if you plan * to change it. */ public int hashCode() { return HashCodeUtil.hashCode(0, getGroups()); }
/** * Get hashcode for From. WARNING: The hash code relies on the variables * in the select, so changing the variables will change the hash code, causing * a select to be lost in a hash structure. Do not hash a From if you plan * to change it. */ public int hashCode() { return HashCodeUtil.hashCode(0, getGroups()); }
/** * Get hashcode for From. WARNING: The hash code relies on the variables * in the select, so changing the variables will change the hash code, causing * a select to be lost in a hash structure. Do not hash a From if you plan * to change it. */ public int hashCode() { return HashCodeUtil.hashCode(0, getGroups()); }
private Map<Integer, Object> createXMLColumnMetadata(Query xmlCommand) { GroupSymbol doc = xmlCommand.getFrom().getGroups().get(0); Map<Integer, Object> xmlMetadata = getDefaultColumn(doc.getName(), XML_COLUMN_NAME, XMLType.class); // Override size as XML may be big xmlMetadata.put(ResultsMetadataConstants.DISPLAY_SIZE, JDBCSQLTypeInfo.XML_COLUMN_LENGTH); return xmlMetadata; }
@Override public void visit(Query query) { //don't allow confusion with deep nesting by removing intermediate groups List<GroupSymbol> fromGroups = null; if (query.getFrom() != null) { fromGroups = query.getFrom().getGroups(); HashMap<GroupSymbol, GroupSymbol> groupMap = new HashMap<GroupSymbol, GroupSymbol>(); for (GroupSymbol g : fromGroups) { groupMap.put(g, g); } visitor.outerGroups.add(groupMap); } super.visit(query); if (fromGroups != null) { visitor.outerGroups.remove(visitor.outerGroups.size() - 1); } } });
@Override public void visit(Query query) { //don't allow confusion with deep nesting by removing intermediate groups List<GroupSymbol> fromGroups = null; if (query.getFrom() != null) { fromGroups = query.getFrom().getGroups(); HashMap<GroupSymbol, GroupSymbol> groupMap = new HashMap<GroupSymbol, GroupSymbol>(); for (GroupSymbol g : fromGroups) { groupMap.put(g, g); } visitor.outerGroups.add(groupMap); } super.visit(query); if (fromGroups != null) { visitor.outerGroups.remove(visitor.outerGroups.size() - 1); } } });
@Override public void visit(Query query) { //don't allow confusion with deep nesting by removing intermediate groups List<GroupSymbol> fromGroups = null; if (query.getFrom() != null) { fromGroups = query.getFrom().getGroups(); HashMap<GroupSymbol, GroupSymbol> groupMap = new HashMap<GroupSymbol, GroupSymbol>(); for (GroupSymbol g : fromGroups) { groupMap.put(g, g); } visitor.outerGroups.add(groupMap); } super.visit(query); if (fromGroups != null) { visitor.outerGroups.remove(visitor.outerGroups.size() - 1); } } });
Set<GroupSymbol> groups = new HashSet<GroupSymbol>(query.getFrom().getGroups()); for (GroupSymbol groupSymbol : groups) { if (metadata.getUniqueKeysInGroup(groupSymbol.getMetadataID()).isEmpty()) {
private void helpCheckFrom(Query query, String[] groupIDs) { From from = query.getFrom(); List<GroupSymbol> groups = from.getGroups(); assertEquals("Wrong number of group IDs: ", groupIDs.length, groups.size()); //$NON-NLS-1$ for(int i=0; i<groups.size(); i++) { GroupSymbol group = groups.get(i); assertNotNull(group.getMetadataID()); assertEquals("Group ID does not match: ", groupIDs[i].toUpperCase(), group.getNonCorrelationName().toUpperCase()); //$NON-NLS-1$ } }
List<Criteria> current = Criteria.separateCriteriaByAnd(query.getCriteria()); query.setCriteria(null); List<GroupSymbol> groups = query.getFrom().getGroups(); TreeSet<String> names = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (GroupSymbol gs : groups) {
List<Criteria> current = Criteria.separateCriteriaByAnd(query.getCriteria()); query.setCriteria(null); List<GroupSymbol> groups = query.getFrom().getGroups(); TreeSet<String> names = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (GroupSymbol gs : groups) {
List<Criteria> current = Criteria.separateCriteriaByAnd(query.getCriteria()); query.setCriteria(null); List<GroupSymbol> groups = query.getFrom().getGroups(); TreeSet<String> names = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); for (GroupSymbol gs : groups) {
} else { validateNoAggsInClause(query.getFrom()); correlationGroups = query.getFrom().getGroups();
} else { validateNoAggsInClause(query.getFrom()); correlationGroups = query.getFrom().getGroups();
private GroupSymbol getQueryGroup(Query query) throws TeiidComponentException { GroupSymbol group; From from = query.getFrom(); List groups = from.getGroups(); if(groups.size() != 1) { throw new TeiidComponentException("Cannot build fake tuple source for command: " + query); //$NON-NLS-1$ } group = (GroupSymbol) groups.get(0); Iterator projSymbols = query.getSelect().getProjectedSymbols().iterator(); while (projSymbols.hasNext()) { Object symbol = projSymbols.next(); if (symbol instanceof ElementSymbol){ ElementSymbol elementSymbol = (ElementSymbol)symbol; GroupSymbol g = elementSymbol.getGroupSymbol(); if (!g.equals(group)){ throw new TeiidComponentException("Illegal symbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } if (elementSymbol.getMetadataID() == null){ throw new TeiidComponentException("Illegal null metadata ID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } else if (elementSymbol.getMetadataID() instanceof TempMetadataID){ throw new TeiidComponentException("Illegal TempMetadataID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query); //$NON-NLS-1$ //$NON-NLS-2$ } } } return group; }
return; List<GroupSymbol> groups = q.getFrom().getGroups(); if (groups.size() != 1) { return;
GroupSymbol group = xmlQuery.getFrom().getGroups().iterator().next();