prestodb/presto · error · SQLException

Column label is null

Error message

Column label is null

What it means

columnIndex(label) is a validation guard: when a String column label is passed as null it throws this SQLException before consulting the field map. Column lookups by label require a non-null label argument.

Source

Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1709

        }
        return columnInfoList.get(index - 1);
    }

    private Object column(String label)
            throws SQLException
    {
        checkOpen();
        checkValidRow();
        Object value = row.get().get(columnIndex(label) - 1);
        wasNull.set(value == null);
        return value;
    }

    private int columnIndex(String label)
            throws SQLException
    {
        if (label == null) {
            throw new SQLException("Column label is null");
        }
        Integer index = fieldMap.get(label.toLowerCase(ENGLISH));
        if (index == null) {
            throw new SQLException("Invalid column label: " + label);
        }
        return index;
    }

    private static Number toNumber(Object value)
            throws SQLException
    {
        if (value == null) {
            return 0;
        }
        if (value instanceof Number) {
            return (Number) value;
        }
        if (value instanceof Boolean) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Pass a non-null column label string from the query result
  2. Validate user-supplied column names before calling getXxx(String) methods
  3. Catch SQLException in generic framework code that may pass null labels
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1709 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/6626b7d764c0899d. Report an issue: GitHub.