{"record":{"id":"b8efda0b90d6eab2","repo":"t8y2/dbx","slug":"table-is-required","errorCode":null,"errorMessage":"table is required","messagePattern":"table is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/metadata.go","lineNumber":597,"sourceCode":"\t\t}\n\t}\n\treturn false\n}\n\n// acceptsRoutineType reports whether the requested object types include the\n// given routine kind (case-insensitive).\nfunc acceptsRoutineType(objectTypes []string, routineType string) bool {\n\tfor _, objectType := range objectTypes {\n\t\tif strings.EqualFold(objectType, routineType) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc (server *server) getColumns(schema, table string) ([]columnInfo, error) {\n\tif strings.TrimSpace(table) == \"\" {\n\t\treturn nil, errors.New(\"table is required\")\n\t}\n\tschema = firstNonEmpty(schema, server.config.Database)\n\tmetadataResult, metadataErr := server.hiveMetadata(func(ctx context.Context, provider gohive.MetadataProvider) (gohive.MetadataResult, error) {\n\t\treturn provider.GetHiveColumns(ctx, schema, table, \"%\")\n\t})\n\tif metadataErr == nil {\n\t\trows := newHiveMetadataRows(metadataResult)\n\t\tvalues := make([]columnInfo, 0, len(rows.rows))\n\t\tfor _, row := range rows.rows {\n\t\t\tname := metadataString(rows.value(row, \"COLUMN_NAME\"))\n\t\t\tif name == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdataType := metadataString(rows.value(row, \"TYPE_NAME\"))\n\t\t\tcolumnSize := metadataIntPointer(rows.value(row, \"COLUMN_SIZE\"))\n\t\t\tvalues = append(values, columnInfo{\n\t\t\t\tName:                   name,\n\t\t\t\tDataType:               dataType,","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/metadata.go#L579-L615","documentation":"getColumns fetches Hive column metadata for a table and validates that a non-blank table name was supplied before issuing the GetHiveColumns RPC. A table name of \"\" or whitespace-only cannot be passed to the metadata provider, so the call fails fast with this error.","triggerScenarios":"Calling getColumns (via the describe-table / get_columns dispatch path) with table == \"\" or table == \"   \"; a client request omitting the table parameter; schema optionally defaulted from server.config.Database.","commonSituations":"Client tool sends describeColumns without the table field; caller transposed schema and table arguments; upstream variable never populated because a prior listing call returned empty names.","solutions":["Ensure the client request includes a non-empty table name","Validate table name in the caller before invoking the metadata operation","Check argument order — schema is the first parameter, table the second; a swap can leave table empty","Default to an explicit table name rather than relying on an empty string to mean 'any'"],"exampleFix":"// before\nserver.getColumns(\"default\", \"\") // error: table is required\n// after\nif table := strings.TrimSpace(req.Table); table != \"\" {\n    server.getColumns(req.Schema, table)\n}","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(table) == \"\" {\n    return errors.New(\"table is required\")\n}","typeGuard":null,"tryCatchPattern":"cols, err := server.getColumns(schema, table)\nif err != nil && err.Error() == \"table is required\" {\n    return fmt.Errorf(\"describe requires a table name, got %q\", table)\n}","preventionTips":["Validate table name at the request layer","Double-check schema/table argument order","Never rely on empty string to mean 'all tables' — use the listing API","Trim inputs and treat whitespace as missing"],"tags":["validation","metadata","parameters"],"backgroundTag":"missing-required-parameter","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}