{"record":{"id":"f855d88da875da71","repo":"prestodb/presto","slug":"lance-error-f855d8","errorCode":"LANCE_ERROR","errorMessage":"Failed to write Lance fragments: \" + e.getMessage()","messagePattern":"Failed to write Lance fragments: \" \\+ e\\.getMessage\\(\\)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-lance/src/main/java/com/facebook/presto/lance/LancePageSink.java","lineNumber":109,"sourceCode":"            String fragmentsJson;\n            if (bufferedPages.isEmpty()) {\n                fragmentsJson = \"[]\";\n            }\n            else {\n                fragmentsJson = writeFragments();\n            }\n\n            LanceCommitTaskData commitData = new LanceCommitTaskData(\n                    fragmentsJson, writtenBytes, rowCount);\n\n            Slice slice = Slices.wrappedBuffer(jsonCodec.toJsonBytes(commitData));\n            return completedFuture(ImmutableList.of(slice));\n        }\n        catch (PrestoException e) {\n            throw e;\n        }\n        catch (Exception e) {\n            throw new PrestoException(LanceErrorCode.LANCE_ERROR,\n                    \"Failed to write Lance fragments: \" + e.getMessage(), e);\n        }\n        finally {\n            cleanup();\n        }\n    }\n\n    private String writeFragments()\n    {\n        try (VectorSchemaRoot root = VectorSchemaRoot.create(arrowSchema, allocator)) {\n            long totalRowsLong = bufferedPages.stream()\n                    .mapToLong(Page::getPositionCount)\n                    .sum();\n            if (totalRowsLong > Integer.MAX_VALUE) {\n                throw new PrestoException(LanceErrorCode.LANCE_ERROR,\n                        \"Total row count exceeds maximum: \" + totalRowsLong);\n            }\n            int totalRows = (int) totalRowsLong;","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lance/src/main/java/com/facebook/presto/lance/LancePageSink.java#L91-L127","documentation":"Catch-all in LancePageSink.finish(): writing the buffered pages as Lance fragments failed with a non-Presto exception. The original exception's message is appended; PrestoExceptions are rethrown unchanged, so this indicates an unexpected failure in the fragment write path (I/O, Arrow encoding, or Lance SDK error).","triggerScenarios":"Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LancePageSink.java:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the appended cause message to identify the underlying Arrow/Lance/IO failure","Verify the target Lance dataset location is writable and has space","Check the row data conforms to the table's Arrow schema"],"exampleFix":null,"handlingStrategy":"try-catch","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"}