{"record":{"id":"8ec270bf834a96d6","repo":"prestodb/presto","slug":"expected-current-entry-to-be-closed-but-was-opened","errorCode":null,"errorMessage":"Expected current entry to be closed but was opened","messagePattern":"Expected current entry to be closed but was opened","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlockBuilder.java","lineNumber":161,"sourceCode":"\n    @Override\n    public boolean mayHaveNull()\n    {\n        return hasNullValue;\n    }\n\n    @Override\n    public boolean isNull(int position)\n    {\n        checkReadablePosition(position);\n        return hasNullValue && valueIsNull[position];\n    }\n\n    @Override\n    public BlockBuilder appendStructure(Block block)\n    {\n        if (currentEntryOpened) {\n            throw new IllegalStateException(\"Expected current entry to be closed but was opened\");\n        }\n        currentEntryOpened = true;\n\n        for (int i = 0; i < block.getPositionCount(); i++) {\n            if (block.isNull(i)) {\n                values.appendNull();\n            }\n            else {\n                block.writePositionTo(i, values);\n            }\n        }\n\n        closeEntry();\n        return this;\n    }\n\n    @Override\n    public Block getSingleValueBlock(int position)","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlockBuilder.java#L143-L179","documentation":"appendStructure on ArrayBlockBuilder requires no entry currently open (newEntry begun but not closed); this IllegalStateException fires when a nested or unclosed appendStructure call tries to start another structure entry.","triggerScenarios":"Thrown at presto-common/src/main/java/com/facebook/presto/common/block/ArrayBlockBuilder.java:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call closeEntry() before appending the next structure","Audit nested block builder usage for missing close calls on error paths"],"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"}