private static Pair<GroupByDesc,VectorGroupByDesc> buildGroupByDescType( VectorizationContext ctx, String aggregate, GenericUDAFEvaluator.Mode mode, String column, TypeInfo dataType) { AggregationDesc agg = buildAggregationDesc(ctx, aggregate, mode, column, dataType); ArrayList<AggregationDesc> aggs = new ArrayList<AggregationDesc>(); aggs.add(agg); ArrayList<String> outputColumnNames = new ArrayList<String>(); outputColumnNames.add("_col0"); GroupByDesc desc = new GroupByDesc(); VectorGroupByDesc vectorDesc = new VectorGroupByDesc(); desc.setOutputColumnNames(outputColumnNames); desc.setAggregators(aggs); vectorDesc.setProcessingMode(ProcessingMode.GLOBAL); return new Pair<GroupByDesc,VectorGroupByDesc>(desc, vectorDesc); }
private static Pair<GroupByDesc,VectorGroupByDesc> buildGroupByDescCountStar( VectorizationContext ctx) { AggregationDesc agg = buildAggregationDescCountStar(ctx); ArrayList<AggregationDesc> aggs = new ArrayList<AggregationDesc>(); aggs.add(agg); ArrayList<String> outputColumnNames = new ArrayList<String>(); outputColumnNames.add("_col0"); GroupByDesc desc = new GroupByDesc(); VectorGroupByDesc vectorDesc = new VectorGroupByDesc(); vectorDesc.setVecAggrDescs( new VectorAggregationDesc[] { new VectorAggregationDesc( agg.getGenericUDAFName(), new GenericUDAFCount.GenericUDAFCountEvaluator(), agg.getMode(), null, ColumnVector.Type.NONE, null, TypeInfoFactory.longTypeInfo, ColumnVector.Type.LONG, VectorUDAFCountStar.class)}); vectorDesc.setProcessingMode(VectorGroupByDesc.ProcessingMode.HASH); desc.setOutputColumnNames(outputColumnNames); desc.setAggregators(aggs); return new Pair<GroupByDesc,VectorGroupByDesc>(desc, vectorDesc); }
public static <A,B> Pair<A,B> of(A a, B b) { return new Pair<A,B>(a,b); } }
public static <A,B> Pair<A,B> of(A a, B b) { return new Pair<A,B>(a,b); } }
public static <A,B> Pair<A,B> of(A a, B b) { return new Pair<A,B>(a,b); } }
/** Returns true if an error needs to be reported for a given * source name and pos. */ protected boolean shouldReport(JavaFileObject file, int pos) { if (multipleErrors || file == null) return true; Pair<JavaFileObject,Integer> coords = new Pair<JavaFileObject,Integer>(file, pos); boolean shouldReport = !recorded.contains(coords); if (shouldReport) recorded.add(coords); return shouldReport; }
/** Returns true if an error needs to be reported for a given * source name and pos. */ protected boolean shouldReport(JavaFileObject file, int pos) { if (multipleErrors || file == null) return true; Pair<JavaFileObject,Integer> coords = new Pair<JavaFileObject,Integer>(file, pos); boolean shouldReport = !recorded.contains(coords); if (shouldReport) recorded.add(coords); return shouldReport; }
/** Returns true if an error needs to be reported for a given * source name and pos. */ protected boolean shouldReport(JavaFileObject file, int pos) { if (multipleErrors || file == null) return true; Pair<JavaFileObject,Integer> coords = new Pair<JavaFileObject,Integer>(file, pos); boolean shouldReport = !recorded.contains(coords); if (shouldReport) recorded.add(coords); return shouldReport; }
/** Returns true if an error needs to be reported for a given * source name and pos. */ protected boolean shouldReport(JavaFileObject file, int pos) { if (multipleErrors || file == null) return true; Pair<JavaFileObject,Integer> coords = new Pair<JavaFileObject,Integer>(file, pos); boolean shouldReport = !recorded.contains(coords); if (shouldReport) recorded.add(coords); return shouldReport; }
protected Pair<Symbol, JCDiagnostic> errCandidate() { Candidate bestSoFar = null; for (Candidate c : resolveContext.candidates) { if (c.isApplicable()) continue; bestSoFar = c; } Assert.checkNonNull(bestSoFar); return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details); } }
protected Pair<Symbol, JCDiagnostic> errCandidate() { Candidate bestSoFar = null; for (Candidate c : resolveContext.candidates) { if (c.isApplicable()) continue; bestSoFar = c; } Assert.checkNonNull(bestSoFar); return new Pair<Symbol, JCDiagnostic>(bestSoFar.sym, bestSoFar.details); } }
private Pair<Type, Type> getParameterizedSupers(Type t, Type s) { Type lubResult = types.lub(t, s); if (lubResult == syms.errType || lubResult == syms.botType || !lubResult.isParameterized()) { return null; } Type asSuperOfT = types.asSuper(t, lubResult.tsym); Type asSuperOfS = types.asSuper(s, lubResult.tsym); return new Pair<>(asSuperOfT, asSuperOfS); }
Attribute.Compound deproxyCompound(CompoundAnnotationProxy a) { ListBuffer<Pair<Symbol.MethodSymbol,Attribute>> buf = new ListBuffer<Pair<Symbol.MethodSymbol,Attribute>>(); for (List<Pair<Name,Attribute>> l = a.values; l.nonEmpty(); l = l.tail) { MethodSymbol meth = findAccessMethod(a.type, l.head.fst); buf.append(new Pair<Symbol.MethodSymbol,Attribute> (meth, deproxy(meth.type.getReturnType(), l.head.snd))); } return new Attribute.Compound(a.type, buf.toList()); }
Attribute.Compound deproxyCompound(CompoundAnnotationProxy a) { ListBuffer<Pair<Symbol.MethodSymbol,Attribute>> buf = new ListBuffer<Pair<Symbol.MethodSymbol,Attribute>>(); for (List<Pair<Name,Attribute>> l = a.values; l.nonEmpty(); l = l.tail) { MethodSymbol meth = findAccessMethod(a.type, l.head.fst); buf.append(new Pair<Symbol.MethodSymbol,Attribute> (meth, deproxy(meth.type.getReturnType(), l.head.snd))); } return new Attribute.Compound(a.type, buf.toList()); }
Attribute.Compound deproxyCompound(CompoundAnnotationProxy a) { ListBuffer<Pair<Symbol.MethodSymbol,Attribute>> buf = new ListBuffer<Pair<Symbol.MethodSymbol,Attribute>>(); for (List<Pair<Name,Attribute>> l = a.values; l.nonEmpty(); l = l.tail) { MethodSymbol meth = findAccessMethod(a.type, l.head.fst); buf.append(new Pair<Symbol.MethodSymbol,Attribute> (meth, deproxy(meth.type.getReturnType(), l.head.snd))); } return new Attribute.Compound(a.type, buf.toList()); }
Attribute.Compound deproxyCompound(CompoundAnnotationProxy a) { ListBuffer<Pair<Symbol.MethodSymbol,Attribute>> buf = new ListBuffer<Pair<Symbol.MethodSymbol,Attribute>>(); for (List<Pair<Name,Attribute>> l = a.values; l.nonEmpty(); l = l.tail) { MethodSymbol meth = findAccessMethod(a.type, l.head.fst); buf.append(new Pair<Symbol.MethodSymbol,Attribute> (meth, deproxy(meth.type.getReturnType(), l.head.snd))); } return new Attribute.Compound(a.type, buf.toList()); }
CompoundAnnotationProxy readCompoundAnnotation() { Type t = readTypeOrClassSymbol(nextChar()); int numFields = nextChar(); ListBuffer<Pair<Name,Attribute>> pairs = new ListBuffer<Pair<Name,Attribute>>(); for (int i=0; i<numFields; i++) { Name name = readName(nextChar()); Attribute value = readAttributeValue(); pairs.append(new Pair<Name,Attribute>(name, value)); } return new CompoundAnnotationProxy(t, pairs.toList()); }
CompoundAnnotationProxy readCompoundAnnotation() { Type t = readTypeOrClassSymbol(nextChar()); int numFields = nextChar(); ListBuffer<Pair<Name,Attribute>> pairs = new ListBuffer<Pair<Name,Attribute>>(); for (int i=0; i<numFields; i++) { Name name = readName(nextChar()); Attribute value = readAttributeValue(); pairs.append(new Pair<Name,Attribute>(name, value)); } return new CompoundAnnotationProxy(t, pairs.toList()); }
CompoundAnnotationProxy readCompoundAnnotation() { Type t = readTypeOrClassSymbol(nextChar()); int numFields = nextChar(); ListBuffer<Pair<Name,Attribute>> pairs = new ListBuffer<Pair<Name,Attribute>>(); for (int i=0; i<numFields; i++) { Name name = readName(nextChar()); Attribute value = readAttributeValue(); pairs.append(new Pair<Name,Attribute>(name, value)); } return new CompoundAnnotationProxy(t, pairs.toList()); }
CompoundAnnotationProxy readCompoundAnnotation() { Type t = readTypeOrClassSymbol(nextChar()); int numFields = nextChar(); ListBuffer<Pair<Name,Attribute>> pairs = new ListBuffer<Pair<Name,Attribute>>(); for (int i=0; i<numFields; i++) { Name name = readName(nextChar()); Attribute value = readAttributeValue(); pairs.append(new Pair<Name,Attribute>(name, value)); } return new CompoundAnnotationProxy(t, pairs.toList()); }