{"record":{"id":"9d0993052fb6d6a4","repo":"prestodb/presto","slug":"databasemetadata","errorCode":null,"errorMessage":"DatabaseMetaData","messagePattern":"DatabaseMetaData","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDatabaseMetaData.java","lineNumber":1367,"sourceCode":"    {\n        return select(format(\"SELECT * FROM (VALUES%n\" +\n                        \"        ('ApplicationName', %s, 'presto-jdbc', 'Sets the source of the session'),%n\" +\n                        \"        ('ClientInfo', %s, NULL, 'Sets the client info of the session'),        %n\" +\n                        \"        ('ClientTags', %s, NULL, 'Comma-delimited string of tags for the session'),        %n\" +\n                        \"        ('TraceToken', %s, NULL, 'Sets the trace token of the session')        %n\" +\n                        \") AS t (NAME, MAX_LEN, DEFAULT_VALUE, DESCRIPTION)\",\n                MAX_LENGTH,\n                MAX_LENGTH,\n                MAX_LENGTH,\n                MAX_LENGTH));\n    }\n\n    @Override\n    public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern)\n            throws SQLException\n    {\n        // TODO: implement this\n        throw new NotImplementedException(\"DatabaseMetaData\", \"getFunctions\");\n    }\n\n    @Override\n    public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern)\n            throws SQLException\n    {\n        // TODO: implement this\n        throw new NotImplementedException(\"DatabaseMetaData\", \"getFunctionColumns\");\n    }\n\n    @Override\n    public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)\n            throws SQLException\n    {\n        return selectEmpty(\"\" +\n                \"SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, COLUMN_NAME, DATA_TYPE,\\n\" +\n                \"  COLUMN_SIZE, DECIMAL_DIGITS, NUM_PREC_RADIX, COLUMN_USAGE, REMARKS,\\n\" +\n                \"  CHAR_OCTET_LENGTH, IS_NULLABLE\\n\" +","sourceCodeStart":1349,"sourceCodeEnd":1385,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-jdbc/src/main/java/com/facebook/presto/jdbc/PrestoDatabaseMetaData.java#L1349-L1385","documentation":"getFunctions() in PrestoDatabaseMetaData throws NotImplementedException('DatabaseMetaData', 'getFunctions'). The driver has not implemented listing SQL functions via JDBC metadata yet, even though Presto itself has functions. The NotImplementedException is a marker from the air lift/joda helper indicating an interface method that is still a TODO.","triggerScenarios":"Calling DatabaseMetaData.getFunctions(catalog, schemaPattern, functionNamePattern) on a Presto connection — e.g. IDE function completion or documentation tools.","commonSituations":"SQL editors with autocomplete that enumerate functions, metadata-crawling tools, upgrading JDBC client versions whose tooling newly calls getFunctions.","solutions":["Avoid getFunctions on Presto; document available functions from Presto docs instead","Catch NotImplementedException and return an empty functions result","Query Presto system catalogs (e.g. SHOW FUNCTIONS) via Statement instead of metadata API","Upgrade the Presto JDBC driver to a version where getFunctions is implemented, if available"],"exampleFix":"// before\nResultSet fns = meta.getFunctions(catalog, schemaPattern, \"%\");\n// after\nResultSet fns;\ntry {\n    fns = meta.getFunctions(catalog, schemaPattern, \"%\");\n} catch (NotImplementedException e) {\n    fns = stmt.executeQuery(\"SHOW FUNCTIONS\"); // Presto-specific fallback\n}","handlingStrategy":"try-catch","validationCode":"boolean supportsGetFunctions = !(meta instanceof com.facebook.presto.jdbc.PrestoDatabaseMetaData);","typeGuard":"boolean supportsGetFunctions = !(meta instanceof com.facebook.presto.jdbc.PrestoDatabaseMetaData);","tryCatchPattern":"try (ResultSet rs = meta.getFunctions(cat, schemaPattern, fnPattern)) { ... } catch (NotImplementedException e) { /* fall back to SHOW FUNCTIONS via Statement */ }","preventionTips":["Use SHOW FUNCTIONS statements instead of getFunctions for Presto","Feature-detect metadata methods before calling","Track driver changelog for when getFunctions is implemented"],"tags":["jdbc","unimplemented","metadata","functions"],"backgroundTag":"jdbc-feature-not-supported","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"}