{"record":{"id":"00a722cf3e7d67c7","repo":"prestodb/presto","slug":"isnull-length-is-less-than-positioncount","errorCode":null,"errorMessage":"isNull length is less than positionCount","messagePattern":"isNull length is less than positionCount","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlock.java","lineNumber":86,"sourceCode":"     */\n    static ArrayBlock createArrayBlockInternal(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values)\n    {\n        validateConstructorArguments(arrayOffset, positionCount, valueIsNull, offsets, values);\n        return new ArrayBlock(arrayOffset, positionCount, valueIsNull, offsets, values);\n    }\n\n    private static void validateConstructorArguments(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values)\n    {\n        if (arrayOffset < 0) {\n            throw new IllegalArgumentException(\"arrayOffset is negative\");\n        }\n\n        if (positionCount < 0) {\n            throw new IllegalArgumentException(\"positionCount is negative\");\n        }\n\n        if (valueIsNull != null && valueIsNull.length - arrayOffset < positionCount) {\n            throw new IllegalArgumentException(\"isNull length is less than positionCount\");\n        }\n\n        requireNonNull(offsets, \"offsets is null\");\n        if (offsets.length - arrayOffset < positionCount + 1) {\n            throw new IllegalArgumentException(\"offsets length is less than positionCount\");\n        }\n\n        requireNonNull(values, \"values is null\");\n    }\n\n    /**\n     * Use createArrayBlockInternal or fromElementBlock instead of this method.  The caller of this method is assumed to have\n     * validated the arguments with validateConstructorArguments.\n     */\n    private ArrayBlock(int arrayOffset, int positionCount, @Nullable boolean[] valueIsNull, int[] offsets, Block values)\n    {\n        // caller must check arguments with validateConstructorArguments\n        this.arrayOffset = arrayOffset;","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlock.java#L68-L104","documentation":"validateConstructorArguments checks that the valueIsNull boolean array (after arrayOffset) covers positionCount entries; a shorter array cannot describe nullness for every position, so construction is rejected.","triggerScenarios":"Thrown at presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlock.java:86 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the valueIsNull array is sized at least arrayOffset + positionCount","Fix the producer that sized the null mask incorrectly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}