presto-main/src/main/java/io/prestosql/operator/scalar/ArraySubscriptOperator.java/ArraySubscriptOperator/checkIndex
class ArraySubscriptOperator:    public static void checkIndex(Block array, long index)
    {
        checkArrayIndex(index);
        if (index > array.getPositionCount()) {
            throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Array subscript must be less than or equal to array length: %s > %s", index, array.getPositionCount()));
        }
    }