t8y2/dbx · error · SQLException
Unsupported object_type for Hive/Inceptor routine source:
Error message
Unsupported object_type for Hive/Inceptor routine source:
What it means
After the database candidates are resolved, the plugin only knows how to build source queries for normalized types PROCEDURE and FUNCTION; any other objectType value hits the else branch and throws. The message concatenates the raw objectType so the caller can see the unsupported value.
Source
Thrown at plugins/jdbc/src/main/java/app/dbx/jdbc/DbxJdbcPlugin.java:4008
}
String sc = emptyToNull(schema);
if (sc != null) {
candidates.add(sc);
}
if (candidates.isEmpty()) {
throw new SQLException("Object source requires database context for Hive/Inceptor routines");
}
for (String candidateDb : candidates) {
String sql;
if ("PROCEDURE".equals(normalizedType)) {
sql = "SELECT full_text FROM system.procedures_v " +
"WHERE lower(database_name) = lower(?) AND procedure_name = ?";
} else if ("FUNCTION".equals(normalizedType)) {
sql = "SELECT full_text FROM system.functions_v " +
"WHERE lower(database_name) = lower(?) AND function_name = ?";
} else {
throw new SQLException("Unsupported object_type for Hive/Inceptor routine source: " + objectType);
}
try (PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setString(1, candidateDb);
ps.setString(2, routineName);
try (ResultSet rs = ps.executeQuery()) {
if (!rs.next()) {
continue;
}
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;
}
}
}View on GitHub (pinned to c0390bff16)
Solutions
- Pass objectType exactly as "PROCEDURE" or "FUNCTION" for Hive/Inceptor routines
- Route tables/views through the TABLE path (genericTableObjectSource or SHOW CREATE TABLE path) instead
- Trim/normalize the type string client-side before the call
- Check plugin version for newly supported routine types
Example fix
// before getRoutineSource(conn, db, "my_proc", "VIEW"); // after getRoutineSource(conn, db, "my_proc", "PROCEDURE"); // or use the table/view source RPC
Defensive patterns
Strategy: validation
Validate before calling
static boolean isRoutineType(String t) {
String n = t == null ? "" : t.trim().toUpperCase(Locale.ROOT);
return n.equals("PROCEDURE") || n.equals("FUNCTION");
}
if (!isRoutineType(objectType)) { /* route to table/view source path instead */ } Type guard
boolean isProcedureOrFunction(String objectType) {
return "PROCEDURE".equalsIgnoreCase(objectType) || "FUNCTION".equalsIgnoreCase(objectType);
} Try / catch
try {
return rpc.objectSource(db, schema, name, objectType);
} catch (SQLException e) {
if (e.getMessage().startsWith("Unsupported object_type")) {
throw new UnsupportedOperationException("Type not supported for routine source: " + objectType, e);
}
throw e;
} Prevention
- Map browse-listing object types to PROCEDURE/FUNCTION before the source call
- Normalize (trim/uppercase) type strings client-side
- Send tables and views through the appropriate table source path
- Verify supported types against the plugin version in use
When it happens
Trigger: Calling the Hive/Inceptor object-source path with objectType values like "TABLE", "VIEW", lowercase "function" that failed to normalize, or a free-form string.
Common situations: Client sends the generic object type from a browse listing instead of mapping it to ROUTINE; UI passes VIEW sources through the routine branch; type-normalization drift after an API upgrade.
Related errors
- Object source requires database context for Hive/Inceptor ro
- Object source requires database context for Hive/Inceptor ob
- JDBC pool registry must be attached before connecting
- Not connected
- JDBC Session was quarantined while waiting for a connection
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/a8001737b6f9012f.
Report an issue: GitHub.