t8y2/dbx · error
HiveServer2 metadata failed (%v); DESCRIBE fallback failed:
Error message
HiveServer2 metadata failed (%v); DESCRIBE fallback failed: %w
What it means
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.
Source
Thrown at agents/drivers/hive-go/metadata.go:640
dataType := metadataString(rows.value(row, "TYPE_NAME"))
columnSize := metadataIntPointer(rows.value(row, "COLUMN_SIZE"))
values = append(values, columnInfo{
Name: name,
DataType: dataType,
IsNullable: metadataNullable(rows.value(row, "NULLABLE", "IS_NULLABLE")),
ColumnDefault: optionalString(metadataString(rows.value(row, "COLUMN_DEF"))),
Comment: optionalString(metadataString(rows.value(row, "REMARKS", "COMMENT"))),
NumericPrecision: columnSize,
NumericScale: metadataIntPointer(rows.value(row, "DECIMAL_DIGITS")),
CharacterMaximumLength: characterLengthForType(dataType, columnSize),
})
}
return values, nil
}
qualified := qualifiedHiveName(schema, table)
result, err := server.executeQuery(queryOptions{SQL: "DESCRIBE " + qualified, MaxRows: metadataQueryLimit})
if err != nil {
return nil, fmt.Errorf("HiveServer2 metadata failed (%v); DESCRIBE fallback failed: %w", metadataErr, err)
}
values := make([]columnInfo, 0, len(result.Rows))
for _, row := range result.Rows {
name := rowString(row, 0)
if name == "" || strings.HasPrefix(name, "#") {
continue
}
dataType := rowString(row, 1)
comment := optionalString(rowString(row, 2))
values = append(values, columnInfo{
Name: name,
DataType: dataType,
IsNullable: true,
Comment: comment,
})
}
return values, nil
}View on GitHub (pinned to c0390bff16)
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
Example fix
// before: table name with wrong case / missing schema
columns, err := server.getColumns("", "MyTable")
// after: explicit schema and Hive-lowercase name
columns, err := server.getColumns("default", "mytable") Defensive patterns
Strategy: validation
Validate before calling
const exists = (await rpc('list_tables', {schema})).tables.some(t => t.name.toLowerCase() === table.toLowerCase())
if (!exists) throw new Error(`table ${schema}.${table} not found`) Try / catch
cols, err := server.getColumns(schema, table)
if err != nil && strings.Contains(err.Error(), "DESCRIBE fallback failed") {
log.Printf("cannot read columns for %s.%s: %v", schema, table, err)
} Prevention
- Validate table existence with list_tables before fetching columns
- Use fully qualified, correctly cased identifiers
- Grant the service account DESCRIBE privileges on target schemas
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- SHOW DATABASES failed (%v); HiveServer2 metadata fallback fa
- HiveServer2 metadata failed (%v); %s fallback failed: %w
- Hive driver does not expose HiveServer2 metadata RPCs
- table is required
- SQL is required
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/5e94b7993d5e0d22.
Report an issue: GitHub.