{"record":{"id":"6ce9f38c1f3a4b0d","repo":"t8y2/dbx","slug":"routine-source-is-not-supported-for-s-connections-6ce9f3","errorCode":null,"errorMessage":"routine source is not supported for %s connections","messagePattern":"routine source is not supported for (.+?) connections","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/metadata.go","lineNumber":744,"sourceCode":"\tfor _, row := range result.Rows {\n\t\tif line := firstRowValue(row); line != \"\" {\n\t\t\tlines = append(lines, line)\n\t\t}\n\t}\n\tif len(lines) == 0 {\n\t\treturn \"\", nil\n\t}\n\treturn strings.Join(lines, \"\\n\") + \"\\n\", nil\n}\n\nfunc (server *server) getObjectSource(database, schema, name, objectType string) (objectSource, error) {\n\tschema = firstNonEmpty(schema, database, server.config.Database)\n\tvar source string\n\tvar err error\n\tswitch strings.ToUpper(objectType) {\n\tcase \"PROCEDURE\", \"FUNCTION\":\n\t\tif !server.supportsRoutines() {\n\t\t\treturn objectSource{}, fmt.Errorf(\"routine source is not supported for %s connections\", server.params.DatabaseType)\n\t\t}\n\t\tsource, err = server.getRoutineSource(database, schema, name, strings.ToUpper(objectType))\n\tdefault:\n\t\tsource, err = server.getTableDDL(schema, name)\n\t}\n\tif err != nil {\n\t\treturn objectSource{}, err\n\t}\n\treturn objectSource{\n\t\tName:       name,\n\t\tObjectType: strings.ToUpper(objectType),\n\t\tSchema:     optionalString(schema),\n\t\tSource:     source,\n\t}, nil\n}\n\n// getRoutineSource fetches a procedure or function's full source from the\n// server's system.procedures_v / system.functions_v view. Returns an empty","sourceCodeStart":726,"sourceCodeEnd":762,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/metadata.go#L726-L762","documentation":"getObjectSource routes PROCEDURE/FUNCTION requests to getRoutineSource, which reads from Transwarp Inceptor system views (system.procedures_v / system.functions_v). Plain Hive and other engine types have no routine source support, so requesting a routine's source on such a connection returns this error naming the connection's DatabaseType.","triggerScenarios":"Calling get_object_source with object_type 'PROCEDURE' or 'FUNCTION' when the connection's DatabaseType is not one of argo/inceptor/inceptor2/transwarp (see supportsRoutines).","commonSituations":"UI sidebar showing a routines node for plain HiveServer2 connections; users clicking a function in a generic Hive connection; tooling that assumes all dialects expose routine DDL like Postgres does.","solutions":["Only request routine sources on Argo/Inceptor (Transwarp) connections","For plain Hive, request TABLE object sources (SHOW CREATE TABLE) instead","Hide/disable the routines node in client UI when the connection's databaseType doesn't support routines","If routine support is needed, connect via an Inceptor (Transwarp) database type"],"exampleFix":"// before: requesting function source on plain Hive\nsource := getObjectSource(db, schema, name, \"FUNCTION\")\n// after: check the database type first\nif isRoutineCapable(dbType) { // argo, inceptor, inceptor2, transwarp\n    source = getObjectSource(db, schema, name, \"FUNCTION\")\n} else {\n    source = getObjectSource(db, schema, name, \"TABLE\")\n}","handlingStrategy":"validation","validationCode":"const routineCapable = [\"argo\", \"inceptor\", \"inceptor2\", \"transwarp\"]\nif ((objectType === \"PROCEDURE\" || objectType === \"FUNCTION\") && !routineCapable.includes(dbType)) {\n    throw new Error(`routine source requires an Inceptor-family connection, got ${dbType}`)\n}","typeGuard":null,"tryCatchPattern":"src, err := server.getObjectSource(db, schema, name, objectType)\nif err != nil && strings.Contains(err.Error(), \"routine source is not supported\") {\n    return objectSource{}, fmt.Errorf(\"%w (use a TABLE source or an Inceptor connection)\", err)\n}","preventionTips":["Gate routine-source UI on the connection's databaseType capability","Check connection_info compatibilityMode before offering routine features","Default non-Inceptor connections to TABLE object sources"],"tags":["hive","routines","unsupported-feature","dialect"],"backgroundTag":"unsupported-feature-for-dialect","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"}