apache/flink · error · ParquetDecodingException

not a valid mode

Error message

not a valid mode 

What it means

Raised in RunLengthDecoder.readNextGroup when the mode decoded from the RLE/bit-packing hybrid header is neither RLE nor PACKED. The header's least-significant bit selects the MODE enum, so reaching the default branch means the value stream is malformed or corrupt (e.g. truncated or misaligned input producing an invalid header), or the encoded data does not follow the Parquet spec's RUN_LENGTH_BIT_PACKING_HYBRID encoding. It indicates the dictionary ids or level stream being decoded cannot be trusted. Reached via readInteger, readDictionaryIds, and readDictionaryIdData.

Solutions

  1. Address the cause reported by the error message: not a valid mode
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("not a valid mode") and rerun the job or command.
Defensive patterns

Strategy: validation

When it happens

Trigger: Triggered at runtime when the operation fails because: not a valid mode.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: not a valid mode.


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

Appendix: source

Thrown at flink-formats/flink-parquet/src/main/java/org/apache/flink/formats/parquet/vector/reader/RunLengthDecoder.java:283

                    while (valueIndex < this.currentCount) {
                        // values are bit packed 8 at a time, so reading bitWidth will always work
                        ByteBuffer buffer = in.slice(bitWidth);
                        if (buffer.hasArray()) {
                            // byte array has better performance than ByteBuffer
                            this.packer.unpack8Values(
                                    buffer.array(),
                                    buffer.arrayOffset() + buffer.position(),
                                    this.currentBuffer,
                                    valueIndex);
                        } else {
                            this.packer.unpack8Values(
                                    buffer, buffer.position(), this.currentBuffer, valueIndex);
                        }
                        valueIndex += 8;
                    }
                    return;
                default:
                    throw new ParquetDecodingException("not a valid mode " + this.mode);
            }
        } catch (IOException e) {
            throw new ParquetDecodingException("Failed to read from input stream", e);
        }
    }

    enum MODE {
        RLE,
        PACKED
    }
}

View on GitHub (pinned to 2f3c205e92)