{"record":{"id":"056ca2d0132d9bed","repo":"t8y2/dbx","slug":"object-source-is-not-supported-056ca2","errorCode":null,"errorMessage":"Object source is not supported","messagePattern":"Object source is not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java","lineNumber":358,"sourceCode":"                            null,\n                            indexType,\n                            null,\n                            null\n                        ));\n                    }\n                }\n            }\n            return result;\n        } catch (Exception e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    @Override\n    public ObjectSource getObjectSource(String schema, String name, String objectType) {\n        String normalizedType = objectType == null ? \"\" : objectType.trim().toUpperCase(Locale.ROOT);\n        if (!\"VIEW\".equals(normalizedType)) {\n            throw new UnsupportedOperationException(\"Object source is not supported\");\n        }\n        return new ObjectSource(name, \"VIEW\", emptyToNull(trim(schema)), viewSource(schema, name), isEditableView(schema, name));\n    }\n\n    @Override\n    public String getTableDdl(String schema, String table) {\n        if (\"VIEW\".equals(tableType(schema, table))) {\n            return viewSource(schema, table);\n        }\n        return super.getTableDdl(schema, table);\n    }\n\n    private List<TableInfo> queryConstrainedTables(String schema, MetadataListConstraints constraints) {\n        if (!constraints.includesTableLikeTypes()) {\n            return List.of();\n        }\n        try {\n            List<TableInfo> result = new ArrayList<>();","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java#L340-L376","documentation":"Gbase8sAgent.getObjectSource supports only VIEW; any other (or null) object type throws UnsupportedOperationException with the fixed message 'Object source is not supported'. The type is trimmed and upper-cased before comparison, so only genuinely non-view types fail.","triggerScenarios":"Calling getObjectSource(schema, name, objectType) with null, empty, or a non-VIEW type such as 'TABLE', 'PROCEDURE', or 'FUNCTION'.","commonSituations":"Generic tooling requests source for procedures or tables; null type from missing metadata; callers expecting parity with other drivers that support more object kinds.","solutions":["Only request VIEW object sources from the Gbase8s driver","Use procedure/table-specific DDL APIs for other object kinds","Pre-check the object type and skip unsupported kinds with a clear user message"],"exampleFix":"// before\nObjectSource src = agent.getObjectSource(schema, name, \"PROCEDURE\");\n// after\nif (\"VIEW\".equalsIgnoreCase(objectType)) {\n    ObjectSource src = agent.getObjectSource(schema, name, objectType);\n} else {\n    throw new UnsupportedOperationException(\"Gbase8s object source only supports VIEW\");\n}","handlingStrategy":"validation","validationCode":"if (objectType == null || !objectType.trim().equalsIgnoreCase(\"VIEW\")) { throw new UnsupportedOperationException(\"GBase8s object source only supports VIEW\"); }","typeGuard":"static boolean supportsGbase8sSource(String t) { return t != null && t.trim().equalsIgnoreCase(\"VIEW\"); }","tryCatchPattern":"try { src = agent.getObjectSource(schema, name, type); } catch (UnsupportedOperationException e) { log.info(\"GBase8s does not expose source for type {}\", type); return Optional.empty(); }","preventionTips":["Only request VIEW sources from the GBase8s driver","Check driver capability metadata before calling getObjectSource for other kinds","Treat UnsupportedOperationException as 'feature not available', not a bug"],"tags":["gbase8s","unsupported-operation","unsupported-object-type","ddl"],"backgroundTag":"unsupported-object-type","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}