@Override public Set asSet() { return new StructSet(this); }
public static SelectResults createStructCollection(boolean distinct, StructType elementType, ExecutionContext context) { return distinct ? new StructSet(elementType) : new StructBag(elementType, context.getCachePerfStats()); }
public static SelectResults createStructCollection(ExecutionContext context, StructType elementType) { return context.isDistinct() ? new StructSet(elementType) : new StructBag(elementType, context.getCachePerfStats()); }
if (isStruct) { StructType stype = (StructType) elementType; this.cumulativeResults = new StructSet(stype); } else { this.cumulativeResults = new ResultsSet(elementType);
@Test public void testIntersectionAndRetainAll() { String names[] = {"p", "pos"}; ObjectType types[] = {TypeUtils.OBJECT_TYPE, TypeUtils.OBJECT_TYPE}; StructTypeImpl sType = new StructTypeImpl(names, types); StructSet set1 = new StructSet(sType); Portfolio ptf = new Portfolio(0); Iterator pIter = ptf.positions.values().iterator(); while (pIter.hasNext()) { Object arr[] = {ptf, pIter.next()}; set1.addFieldValues(arr); } StructSet set2 = new StructSet(sType); pIter = ptf.positions.values().iterator(); while (pIter.hasNext()) { Object arr[] = {ptf, pIter.next()}; set2.addFieldValues(arr); } assertEquals(2, set1.size()); assertEquals(2, set2.size()); // tests that retainAll does not modify set1 assertTrue(!set1.retainAll(set2)); assertEquals(2, set1.size()); assertEquals(2, set2.size()); SelectResults sr = QueryUtils.intersection(set1, set2, null); assertEquals(2, sr.size()); } }
fieldTypes[i] = iter.getElementType(); emptySet = context.isDistinct() ? new StructSet(new StructTypeImpl(fieldNames, fieldTypes)) : new StructBag(0, new StructTypeImpl(fieldNames, fieldTypes), context.getCachePerfStats());
elementType.isStructType(), ignoreOrderBy)) { case UNORDERED_DISTINCT_STRUCT: return new StructSet((StructType) elementType); case UNORDERED_DISTINCT_RESULTS: return new ResultsSet(elementType);