t8y2/dbx · error · UnsupportedOperationException

Object source is not supported

Error message

Object source is not supported

What it means

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.

Source

Thrown at agents/drivers/gbase8s/src/main/java/com/dbx/agent/gbase8s/Gbase8sAgent.java:358

                            null,
                            indexType,
                            null,
                            null
                        ));
                    }
                }
            }
            return result;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public ObjectSource getObjectSource(String schema, String name, String objectType) {
        String normalizedType = objectType == null ? "" : objectType.trim().toUpperCase(Locale.ROOT);
        if (!"VIEW".equals(normalizedType)) {
            throw new UnsupportedOperationException("Object source is not supported");
        }
        return new ObjectSource(name, "VIEW", emptyToNull(trim(schema)), viewSource(schema, name), isEditableView(schema, name));
    }

    @Override
    public String getTableDdl(String schema, String table) {
        if ("VIEW".equals(tableType(schema, table))) {
            return viewSource(schema, table);
        }
        return super.getTableDdl(schema, table);
    }

    private List<TableInfo> queryConstrainedTables(String schema, MetadataListConstraints constraints) {
        if (!constraints.includesTableLikeTypes()) {
            return List.of();
        }
        try {
            List<TableInfo> result = new ArrayList<>();

View on GitHub (pinned to c0390bff16)

Solutions

  1. Only request VIEW object sources from the Gbase8s driver
  2. Use procedure/table-specific DDL APIs for other object kinds
  3. Pre-check the object type and skip unsupported kinds with a clear user message

Example fix

// before
ObjectSource src = agent.getObjectSource(schema, name, "PROCEDURE");
// after
if ("VIEW".equalsIgnoreCase(objectType)) {
    ObjectSource src = agent.getObjectSource(schema, name, objectType);
} else {
    throw new UnsupportedOperationException("Gbase8s object source only supports VIEW");
}
Defensive patterns

Strategy: validation

Validate before calling

if (objectType == null || !objectType.trim().equalsIgnoreCase("VIEW")) { throw new UnsupportedOperationException("GBase8s object source only supports VIEW"); }

Type guard

static boolean supportsGbase8sSource(String t) { return t != null && t.trim().equalsIgnoreCase("VIEW"); }

Try / catch

try { src = agent.getObjectSource(schema, name, type); } catch (UnsupportedOperationException e) { log.info("GBase8s does not expose source for type {}", type); return Optional.empty(); }

Prevention

When it happens

Trigger: Calling getObjectSource(schema, name, objectType) with null, empty, or a non-VIEW type such as 'TABLE', 'PROCEDURE', or 'FUNCTION'.

Common situations: Generic tooling requests source for procedures or tables; null type from missing metadata; callers expecting parity with other drivers that support more object kinds.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/056ca2d0132d9bed. Report an issue: GitHub.