t8y2/dbx · error · SQLException

Object source is not supported by this JDBC driver

Error message

Object source is not supported by this JDBC driver

What it means

Catch-all at the end of the object-source dispatcher: when the normalized object type is neither handled by the Hive/Inceptor branches nor TABLE, the JDBC plugin has no vendor DDL mechanism and refuses the request. It signals a capability limitation of the connected driver rather than a data problem.

Source

Thrown at plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java:4035

                        }
                        ObjectNode item = MAPPER.createObjectNode();
                        item.put("name", name);
                        item.put("object_type", objectType);
                        putNullable(item, "schema", emptyToNull(schema) != null ? schema : candidateDb);
                        putNullable(item, "source", rs.getString(1));
                        return item;
                    }
                }
            }

            throw new SQLException("Object source not found");
        }

        if ("TABLE".equals(normalizeObjectType(objectType))) {
            return genericTableObjectSource(connection, database, schema, name);
        }

        throw new SQLException("Object source is not supported by this JDBC driver");
    }

    /**
     * Table source for generic external JDBC drivers (JDBCX wrappers, custom
     * protocol drivers) that expose no vendor DDL statement: assemble CREATE
     * TABLE from {@code DatabaseMetaData} via the same readers the browse RPCs
     * use, so driver quirks (catalog fallback, PK marking, tolerance of
     * unimplemented metadata methods) apply identically.
     */
    private static JsonNode genericTableObjectSource(JsonNode connection, String database, String schema, String table)
        throws SQLException {
        JsonNode columns = getColumns(connection, database, schema, table);
        if (!columns.isArray() || columns.isEmpty()) {
            throw new SQLException("Object source not found");
        }
        JsonNode indexes = listIndexes(connection, database, schema, table);

        JsonNode foreignKeys;

View on GitHub (pinned to c0390bff16)

Solutions

  1. Request source only for TABLE objects on generic JDBC drivers, or use the Hive-specific branches for views where supported
  2. Recreate DDL manually from column/index metadata returned by the browse RPCs
  3. Check whether a vendor-specific plugin exists for the target database
  4. Upgrade the plugin to a version adding support for the object type

Example fix

// before
source(connection, "MY_SEQ", "SEQUENCE");
// after
source(connection, "orders", "TABLE"); // only TABLE is generically supported
Defensive patterns

Strategy: fallback

Validate before calling

if (!"TABLE".equalsIgnoreCase(objectType)) {
    throw new UnsupportedOperationException(
        "Generic JDBC driver supports source only for TABLE, got: " + objectType);
}

Type guard

boolean supportsSourceFor(String objectType) { return "TABLE".equalsIgnoreCase(objectType); }

Try / catch

try {
    return rpc.objectSource(connCfg, db, schema, name, objectType);
} catch (SQLException e) {
    if (e.getMessage().contains("not supported by this JDBC driver")) {
        // fallback: reconstruct DDL from column/index browse RPCs or vendor tooling
        return rebuildDdlFromMetadata(connCfg, db, schema, name);
    }
    throw e;
}

Prevention

When it happens

Trigger: Requesting source for object types other than TABLE on generic JDBC drivers (e.g. VIEW, SEQUENCE, INDEX, SYNONYM) where the plugin has no source-building branch.

Common situations: Client assumes the driver can emit DDL for every object kind listed in the catalog browse; passing "View" with different casing that misses normalization; driver without metadata support so only the TABLE path exists.

Related errors


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