{"record":{"id":"cafed5517a712289","repo":"prestodb/presto","slug":"invalid-column-label","errorCode":null,"errorMessage":"Invalid column label: ","messagePattern":"Invalid column label: ","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java","lineNumber":1713,"sourceCode":"    private Object column(String label)\n            throws SQLException\n    {\n        checkOpen();\n        checkValidRow();\n        Object value = row.get().get(columnIndex(label) - 1);\n        wasNull.set(value == null);\n        return value;\n    }\n\n    private int columnIndex(String label)\n            throws SQLException\n    {\n        if (label == null) {\n            throw new SQLException(\"Column label is null\");\n        }\n        Integer index = fieldMap.get(label.toLowerCase(ENGLISH));\n        if (index == null) {\n            throw new SQLException(\"Invalid column label: \" + label);\n        }\n        return index;\n    }\n\n    private static Number toNumber(Object value)\n            throws SQLException\n    {\n        if (value == null) {\n            return 0;\n        }\n        if (value instanceof Number) {\n            return (Number) value;\n        }\n        if (value instanceof Boolean) {\n            return ((Boolean) value) ? 1 : 0;\n        }\n        throw new SQLException(\"Value is not a number: \" + value.getClass().getCanonicalName());\n    }","sourceCodeStart":1695,"sourceCodeEnd":1731,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java#L1695-L1731","documentation":"After the null check, columnIndex(label) looks the lowercased label up in the fieldMap built from the result metadata; if no column matches, this SQLException is thrown. It fires when the requested label does not exactly (case-insensitively) match any column name of the executed query — usually a typo or a column that is not in the SELECT list.","triggerScenarios":"Thrown at presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSet.java:1713 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Compare the label against the query's column names via ResultSetMetaData","Fix the spelling/case of the requested column label","Include the missing column in the SELECT list of the query"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}