/** * Returns an appropriate, empty {@code SelectResults} * * @param objectType The {@code ObjectType} of the query results * @return an appropriate, empty {@code SelectResults} */ public static SelectResults getEmptySelectResults(ObjectType objectType, CachePerfStats statsOrNull) { SelectResults emptyResults = null; if (objectType instanceof StructType) { emptyResults = new StructBag((StructTypeImpl) objectType, statsOrNull); } else { emptyResults = new ResultsBag(objectType, statsOrNull); } return emptyResults; }
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()); }
public ResultsBag getBagObject(Class clazz) { ObjectType[] types = new ObjectType[] {new ObjectTypeImpl(clazz), new ObjectTypeImpl(clazz)}; StructType type = new StructTypeImpl(new String[] {"field1", "field2"}, types); return new StructBag(type, null); }
private SelectResults<Struct> buildListOfStructs(String... values) { SelectResults<Struct> results = new StructBag(); StructTypeImpl elementType = new StructTypeImpl(new String[] {"field1"}); results.setElementType(elementType); for (String value : values) { results.add(new StructImpl(elementType, new Object[] {value})); } return results; }
: new StructBag(0, new StructTypeImpl(fieldNames, fieldTypes), context.getCachePerfStats());
return new ResultsSet(elementType); case UNORDERED_INDISTINCT_STRUCT: return new StructBag((StructType) elementType, context.getCachePerfStats()); case UNORDERED_INDISTINCT_RESULTS: return new ResultsBag(elementType, context.getCachePerfStats());