Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.facebook.presto.operator.scalar;
 /*
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import static com.facebook.presto.metadata.FunctionRegistry.operatorInfo;
import static com.facebook.presto.metadata.OperatorType.EQUAL;
import static com.facebook.presto.metadata.OperatorType.NOT_EQUAL;
import static com.facebook.presto.metadata.Signature.comparableTypeParameter;
import static com.facebook.presto.spi.type.TypeSignature.parseTypeSignature;
import static com.facebook.presto.util.Reflection.methodHandle;
        extends ParametricOperator
    public static final ArrayNotEqualOperator ARRAY_NOT_EQUAL = new ArrayNotEqualOperator();
    private static final TypeSignature RETURN_TYPE = parseTypeSignature(.);
    private static final MethodHandle METHOD_HANDLE = methodHandle(ArrayNotEqualOperator.class"notEqual"MethodHandle.classType.classSlice.classSlice.class);
    private ArrayNotEqualOperator()
    {
        super(, ImmutableList.of(comparableTypeParameter("T")), ., ImmutableList.of("array<T>""array<T>"));
    }
    @Override
    public FunctionInfo specialize(Map<StringTypetypesint arityTypeManager typeManagerFunctionRegistry functionRegistry)
    {
        Type elementType = types.get("T");
        Type type = typeManager.getParameterizedType(., ImmutableList.of(elementType.getTypeSignature()), ImmutableList.of());
        TypeSignature typeSignature = type.getTypeSignature();
        MethodHandle equalsFunction = functionRegistry.resolveOperator(, ImmutableList.of(elementTypeelementType)).getMethodHandle();
        MethodHandle method = .bindTo(equalsFunction).bindTo(elementType);
        return operatorInfo(, ImmutableList.of(typeSignaturetypeSignature), methodfalse, ImmutableList.of(falsefalse));
    }
    public static boolean notEqual(MethodHandle equalsFunctionType typeSlice leftSlice right)
    {
        return !ArrayEqualOperator.equals(equalsFunctiontypeleftright);
    }
New to GrepCode? Check out our FAQ X