apache/flink · error · IOException

expecting more rows but reached last block. Read {} out of {

Error message

expecting more rows but reached last block. Read {} out of {}

What it means

Error "expecting more rows but reached last block. Read {} out of {}" thrown in apache/flink.

Source

Thrown at flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/ParquetVectorizedInputFormat.java:424

            int num = (int) Math.min(batchSize, totalCountLoadedSoFar - rowsReturned);
            for (int i = 0; i < columnReaders.length; ++i) {
                if (columnReaders[i] == null) {
                    batch.writableVectors[i].fillWithNulls();
                } else {
                    //noinspection unchecked
                    columnReaders[i].readToVector(num, batch.writableVectors[i]);
                }
            }
            rowsReturned += num;
            batch.columnarBatch.setNumRows(num);
            return true;
        }

        private void readNextRowGroup() throws IOException {
            PageReadStore pages = reader.readNextRowGroup();
            if (pages == null) {
                throw new IOException(
                        "expecting more rows but reached last block. Read "
                                + rowsReturned
                                + " out of "
                                + totalRowCount);
            }

            List<Type> types = requestedSchema.getFields();
            columnReaders = new ColumnReader[types.size()];
            for (int i = 0; i < types.size(); ++i) {
                if (!unknownFieldsIndices.contains(i)) {
                    columnReaders[i] =
                            createColumnReader(
                                    isUtcTimestamp,
                                    projectedTypes[i],
                                    types.get(i),
                                    requestedSchema.getColumns(),
                                    pages,
                                    fields.get(i),

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: expecting more rows but reached last block. Read the reported value out of the reported value
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("expecting more rows but reached last block. Read the reported value out of the reported value") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: expecting more rows but reached last block. Read the reported value out of the reported value.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: expecting more rows but reached last block. Read the reported value out of the reported value.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/77b9aa6f3f593d9b. Report an issue: GitHub.