{"record":{"id":"d53ba7dbde4e1740","repo":"prestodb/presto","slug":"unhandled-nullable-type","errorCode":null,"errorMessage":"Unhandled nullable type: ","messagePattern":"Unhandled nullable type: ","errorType":"exception","errorClass":"SQLException","httpStatus":null,"severity":"warning","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSetMetaData.java","lineNumber":90,"sourceCode":"            throws SQLException\n    {\n        return column(column).isCurrency();\n    }\n\n    @Override\n    public int isNullable(int column)\n            throws SQLException\n    {\n        ColumnInfo.Nullable nullable = column(column).getNullable();\n        switch (nullable) {\n            case NO_NULLS:\n                return columnNoNulls;\n            case NULLABLE:\n                return columnNullable;\n            case UNKNOWN:\n                return columnNullableUnknown;\n        }\n        throw new SQLException(\"Unhandled nullable type: \" + nullable);\n    }\n\n    @Override\n    public boolean isSigned(int column)\n            throws SQLException\n    {\n        return column(column).isSigned();\n    }\n\n    @Override\n    public int getColumnDisplaySize(int column)\n            throws SQLException\n    {\n        return column(column).getColumnDisplaySize();\n    }\n\n    @Override\n    public String getColumnLabel(int column)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoResultSetMetaData.java#L72-L108","documentation":"isNullable() exhaustively switches over the known Nullability values (NO_NULLS/NULLABLE/UNKNOWN mapped to columnNoNulls/columnNullable/columnNullableUnknown) and throws this SQLException for any unhandled enum value. In practice it fires only when the driver and a newer server introduce a Nullability constant this JDBC version does not know.","triggerScenarios":"Calling ResultSetMetaData.isNullable(column) when the column's Nullability enum from the server is a value the loaded driver version doesn't handle (version skew between client and coordinator).","commonSituations":"Mismatched driver/coordinator versions after a Presto server upgrade; custom or patched builds adding new enum constants; rarely, corrupted column metadata.","solutions":["Upgrade the Presto JDBC driver to match the server version","As a workaround, treat the SQLException as 'nullability unknown' (columnNullableUnknown = 2) in calling code","Check driver and coordinator versions match in deployment config"],"exampleFix":"// before\nint n = meta.isNullable(1); // throws on unknown enum\n// after\nint n;\ntry { n = meta.isNullable(1); } catch (SQLException e) { n = java.sql.ResultSetMetaData.columnNullableUnknown; }","handlingStrategy":"try-catch","validationCode":"// pin driver version to coordinator version\nString driverVersion = prestoDriver.getMajorVersion();\nif (!driverVersion.equals(expectedServerMajor)) {\n    log.warn(\"Presto driver {} vs server {} version skew; metadata enums may be unhandled\", driverVersion, expectedServerMajor);\n}","typeGuard":null,"tryCatchPattern":"int nullable;\ntry {\n    nullable = meta.isNullable(col);\n} catch (SQLException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Unhandled nullable type\")) {\n        nullable = java.sql.ResultSetMetaData.columnNullableUnknown; // safe default\n    } else { throw e; }\n}","preventionTips":["Keep the JDBC driver version aligned with the Presto server version","Default to columnNullableUnknown when nullability cannot be determined","Re-test metadata code after server upgrades"],"tags":["jdbc","metadata","version-skew"],"backgroundTag":"jdbc-metadata-unsupported","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"}