prestodb/presto · error · IllegalArgumentException

lineSeparator must not contain Base32 characters: [{sep}]

Error message

lineSeparator must not contain Base32 characters: [{sep}]

What it means

Base32 constructor guard: the provided lineSeparator contains characters that are themselves valid Base32 alphabet characters, which would make encoded output ambiguous/undecodable, so the separator is rejected.

Source

Thrown at presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java:295

    {
        super(BYTES_PER_ENCODED_BLOCK, lineLength,
                lineSeparator == null ? 0 : lineSeparator.length, pad);
        if (useHex) {
            this.encodeTable = HEX_ENCODE_TABLE;
            this.decodeTable = HEX_DECODE_TABLE;
        }
        else {
            this.encodeTable = ENCODE_TABLE;
            this.decodeTable = DECODE_TABLE;
        }
        if (lineLength > 0) {
            if (lineSeparator == null) {
                throw new IllegalArgumentException("lineLength " + lineLength + " > 0, but lineSeparator is null");
            }
            // Must be done after initializing the tables
            if (containsAlphabetOrPad(lineSeparator)) {
                final String sep = StringUtils.newStringUtf8(lineSeparator);
                throw new IllegalArgumentException("lineSeparator must not contain Base32 characters: [" + sep + "]");
            }
            this.encodeSize = BYTES_PER_ENCODED_BLOCK + lineSeparator.length;
            this.lineSeparator = new byte[lineSeparator.length];
            System.arraycopy(lineSeparator, 0, this.lineSeparator, 0, lineSeparator.length);
        }
        else {
            this.encodeSize = BYTES_PER_ENCODED_BLOCK;
            this.lineSeparator = null;
        }
        this.decodeSize = this.encodeSize - 1;

        if (isInAlphabet(pad) || isWhiteSpace(pad)) {
            throw new IllegalArgumentException("pad must not be in alphabet or whitespace");
        }
    }

    /**
     * <p>

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Choose a separator of non-alphabet bytes (e.g. CR/LF)
  2. Remove Base32 characters from the separator
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-common/src/main/java/com/facebook/presto/common/type/encoding/Base32.java:295 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/34202f240a7fc79a. Report an issue: GitHub.