prestodb/presto · error · PrestoException

LANCE_ERROR

LANCE_ERROR

Error message

Failed to write Lance fragments: " + e.getMessage()

What it means

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).

Source

Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LancePageSink.java:109

            String fragmentsJson;
            if (bufferedPages.isEmpty()) {
                fragmentsJson = "[]";
            }
            else {
                fragmentsJson = writeFragments();
            }

            LanceCommitTaskData commitData = new LanceCommitTaskData(
                    fragmentsJson, writtenBytes, rowCount);

            Slice slice = Slices.wrappedBuffer(jsonCodec.toJsonBytes(commitData));
            return completedFuture(ImmutableList.of(slice));
        }
        catch (PrestoException e) {
            throw e;
        }
        catch (Exception e) {
            throw new PrestoException(LanceErrorCode.LANCE_ERROR,
                    "Failed to write Lance fragments: " + e.getMessage(), e);
        }
        finally {
            cleanup();
        }
    }

    private String writeFragments()
    {
        try (VectorSchemaRoot root = VectorSchemaRoot.create(arrowSchema, allocator)) {
            long totalRowsLong = bufferedPages.stream()
                    .mapToLong(Page::getPositionCount)
                    .sum();
            if (totalRowsLong > Integer.MAX_VALUE) {
                throw new PrestoException(LanceErrorCode.LANCE_ERROR,
                        "Total row count exceeds maximum: " + totalRowsLong);
            }
            int totalRows = (int) totalRowsLong;

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Read the appended cause message to identify the underlying Arrow/Lance/IO failure
  2. Verify the target Lance dataset location is writable and has space
  3. Check the row data conforms to the table's Arrow schema
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-lance/src/main/java/com/facebook/presto/lance/LancePageSink.java:109 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/f855d88da875da71. Report an issue: GitHub.