protected AbstractMinMaxAggregationFunction(String name, boolean min) { super(name, ImmutableList.of(orderableTypeParameter("E")), ImmutableList.of(), parseTypeSignature("E"), ImmutableList.of(parseTypeSignature("E"))); this.min = min; this.operatorType = min ? LESS_THAN : GREATER_THAN; }
protected AbstractMinMaxNAggregationFunction(String name, Function<Type, BlockComparator> typeToComparator) { super(name, ImmutableList.of(orderableTypeParameter("E")), ImmutableList.of(), parseTypeSignature("array(E)"), ImmutableList.of(parseTypeSignature("E"), parseTypeSignature(StandardTypes.BIGINT))); requireNonNull(typeToComparator); this.typeToComparator = typeToComparator; }
protected AbstractGreatestLeast(String name, OperatorType operatorType) { super(new Signature( name, FunctionKind.SCALAR, ImmutableList.of(orderableTypeParameter("E")), ImmutableList.of(), parseTypeSignature("E"), ImmutableList.of(parseTypeSignature("E")), true)); this.operatorType = requireNonNull(operatorType, "operatorType is null"); }
protected AbstractMinMaxByNAggregationFunction(String name, Function<Type, BlockComparator> typeToComparator) { super(name, ImmutableList.of(typeVariable("V"), orderableTypeParameter("K")), ImmutableList.of(), parseTypeSignature("array(V)"), ImmutableList.of(parseTypeSignature("V"), parseTypeSignature("K"), parseTypeSignature(StandardTypes.BIGINT))); this.name = requireNonNull(name, "name is null"); this.typeToComparator = requireNonNull(typeToComparator, "typeToComparator is null"); }
protected AbstractMinMaxBy(boolean min) { super((min ? "min" : "max") + "_by", ImmutableList.of(orderableTypeParameter("K"), typeVariable("V")), ImmutableList.of(), parseTypeSignature("V"), ImmutableList.of(parseTypeSignature("V"), parseTypeSignature("K"))); this.min = min; }
String name = typeParameter.value(); if (orderableRequired.contains(name)) { typeVariableConstraints.add(orderableTypeParameter(name));
private ArrayLessThanOrEqualOperator() { super(LESS_THAN_OR_EQUAL, ImmutableList.of(orderableTypeParameter("T")), StandardTypes.BOOLEAN, ImmutableList.of("array(T)", "array(T)")); }
public ArrayIntersectFunction() { super(FUNCTION_NAME, ImmutableList.of(orderableTypeParameter("E")), "array(E)", ImmutableList.of("array(E)", "array(E)")); }
private ArrayLessThanOperator() { super(LESS_THAN, ImmutableList.of(orderableTypeParameter("T")), StandardTypes.BOOLEAN, ImmutableList.of("array(T)", "array(T)")); }
protected AbstractGreatestLeast(String name, OperatorType operatorType) { super(name, ImmutableList.of(orderableTypeParameter("E")), "E", ImmutableList.of("E"), true); this.operatorType = requireNonNull(operatorType, "operatorType is null"); }
private ArrayGreaterThanOrEqualOperator() { super(GREATER_THAN_OR_EQUAL, ImmutableList.of(orderableTypeParameter("T")), StandardTypes.BOOLEAN, ImmutableList.of("array(T)", "array(T)")); }
public ArraySortFunction() { super(FUNCTION_NAME, ImmutableList.of(orderableTypeParameter("E")), "array(E)", ImmutableList.of("array(E)")); }
protected AbstractMinMaxNAggregationFunction(String name, Function<Type, BlockComparator> typeToComparator) { super(name, ImmutableList.of(orderableTypeParameter("E")), "array(E)", ImmutableList.of("E", StandardTypes.BIGINT)); requireNonNull(typeToComparator); this.typeToComparator = typeToComparator; }
protected AbstractMinMaxAggregationFunction(String name, OperatorType operatorType) { super(name, ImmutableList.of(orderableTypeParameter("E")), "E", ImmutableList.of("E")); requireNonNull(operatorType); this.operatorType = operatorType; }
protected AbstractMinMaxBy(boolean min) { super((min ? "min" : "max") + "_by", ImmutableList.of(orderableTypeParameter("K"), typeParameter("V")), "V", ImmutableList.of("V", "K")); this.min = min; }
protected AbstractMinMaxByNAggregationFunction(String name, Function<Type, BlockComparator> typeToComparator) { super(name, ImmutableList.of(typeParameter("V"), orderableTypeParameter("K")), "array(V)", ImmutableList.of("V", "K", StandardTypes.BIGINT)); this.name = requireNonNull(name, "name is null"); this.typeToComparator = requireNonNull(typeToComparator, "typeToComparator is null"); }
.returnType(parseTypeSignature("array(T)")) .argumentTypes(parseTypeSignature("array(T)"), parseTypeSignature("function(T,E)")) .typeVariableConstraints(typeVariable("T"), orderableTypeParameter("E")) .build(); assertThat(sortByKey)
String name = typeParameter.value(); if (orderableRequired.contains(name)) { typeParameterRequirements.add(orderableTypeParameter(name));