{"record":{"id":"5e94b7993d5e0d22","repo":"t8y2/dbx","slug":"hiveserver2-metadata-failed-v-describe-fallbac-5e94b7","errorCode":null,"errorMessage":"HiveServer2 metadata failed (%v); DESCRIBE fallback failed: %w","messagePattern":"HiveServer2 metadata failed \\((.+?)\\); DESCRIBE fallback failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/hive-go/metadata.go","lineNumber":640,"sourceCode":"\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,\n\t\t\t\tIsNullable:             metadataNullable(rows.value(row, \"NULLABLE\", \"IS_NULLABLE\")),\n\t\t\t\tColumnDefault:          optionalString(metadataString(rows.value(row, \"COLUMN_DEF\"))),\n\t\t\t\tComment:                optionalString(metadataString(rows.value(row, \"REMARKS\", \"COMMENT\"))),\n\t\t\t\tNumericPrecision:       columnSize,\n\t\t\t\tNumericScale:           metadataIntPointer(rows.value(row, \"DECIMAL_DIGITS\")),\n\t\t\t\tCharacterMaximumLength: characterLengthForType(dataType, columnSize),\n\t\t\t})\n\t\t}\n\t\treturn values, nil\n\t}\n\tqualified := qualifiedHiveName(schema, table)\n\tresult, err := server.executeQuery(queryOptions{SQL: \"DESCRIBE \" + qualified, MaxRows: metadataQueryLimit})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"HiveServer2 metadata failed (%v); DESCRIBE fallback failed: %w\", metadataErr, err)\n\t}\n\tvalues := make([]columnInfo, 0, len(result.Rows))\n\tfor _, row := range result.Rows {\n\t\tname := rowString(row, 0)\n\t\tif name == \"\" || strings.HasPrefix(name, \"#\") {\n\t\t\tcontinue\n\t\t}\n\t\tdataType := rowString(row, 1)\n\t\tcomment := optionalString(rowString(row, 2))\n\t\tvalues = append(values, columnInfo{\n\t\t\tName:       name,\n\t\t\tDataType:   dataType,\n\t\t\tIsNullable: true,\n\t\t\tComment:    comment,\n\t\t})\n\t}\n\treturn values, nil\n}","sourceCodeStart":622,"sourceCodeEnd":658,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/hive-go/metadata.go#L622-L658","documentation":"getColumns first uses HiveServer2 JDBC metadata (GetHiveColumns); if that fails it falls back to running 'DESCRIBE <schema.table>'. This error is raised when the metadata API fails AND the DESCRIBE fallback also fails, embedding the metadata error and wrapping the DESCRIBE error.","triggerScenarios":"Calling get_columns for a table when both the GetHiveColumns metadata call and the DESCRIBE statement fail — e.g. table does not exist, permission denied on the table, or the connection is broken so both calls fail with transport errors.","commonSituations":"Wrong schema/table name (DESCRIBE on missing table); user without DESCRIBE privileges; connection dropped between the two attempts; case-sensitivity mismatch in the table name.","solutions":["Verify the table exists and the schema/name casing is correct (run DESCRIBE manually in beeline)","Grant the connecting user DESCRIBE/SELECT metadata privileges on the table","Check the first (metadata) error for connectivity — a dead connection fails both paths","Retry after reconnecting if both errors are transport-related"],"exampleFix":"// before: table name with wrong case / missing schema\ncolumns, err := server.getColumns(\"\", \"MyTable\")\n// after: explicit schema and Hive-lowercase name\ncolumns, err := server.getColumns(\"default\", \"mytable\")","handlingStrategy":"validation","validationCode":"const exists = (await rpc('list_tables', {schema})).tables.some(t => t.name.toLowerCase() === table.toLowerCase())\nif (!exists) throw new Error(`table ${schema}.${table} not found`)","typeGuard":null,"tryCatchPattern":"cols, err := server.getColumns(schema, table)\nif err != nil && strings.Contains(err.Error(), \"DESCRIBE fallback failed\") {\n    log.Printf(\"cannot read columns for %s.%s: %v\", schema, table, err)\n}","preventionTips":["Validate table existence with list_tables before fetching columns","Use fully qualified, correctly cased identifiers","Grant the service account DESCRIBE privileges on target schemas"],"tags":["hive","metadata","columns","sql"],"backgroundTag":"metadata-query-failed","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"}