presto-main/src/main/java/io/prestosql/operator/scalar/ArraysOverlapFunction.java/ArraysOverlapFunction/genericArraysOverlap
class ArraysOverlapFunction:    public Boolean genericArraysOverlap(Block leftArray, Block rightArray, AbstractType type)
    {
        int leftSize = leftArray.getPositionCount();
        int rightSize = rightArray.getPositionCount();

        if (leftSize == 0 || rightSize == 0) {
            return false;
        }

        if (leftLongArray == null || leftLongArray.length < leftSize) {
            leftLongArray = new long[leftSize * 2];
        }
        if (rightLongArray == null || rightLongArray.length < rightSize) {
            rightLongArray = new long[rightSize * 2];
        }

        int leftNonNullSize = sortAbstractLongArray(leftArray, leftLongArray, type);
        int rightNonNullSize = sortAbstractLongArray(rightArray, rightLongArray, type);

        int leftPosition = 0;
        int rightPosition = 0;
        while (leftPosition < leftNonNullSize && rightPosition < rightNonNullSize) {
            if (leftLongArray[leftPosition] < rightLongArray[rightPosition]) {
                leftPosition++;
            }
            else if (rightLongArray[rightPosition] < leftLongArray[leftPosition]) {
                rightPosition++;
            }
            else {
                return true;
            }
        }
        return (leftNonNullSize < leftSize) || (rightNonNullSize < rightSize) ? null : false;
    }