t8y2/dbx · error

table is required

Error message

table is required

What it means

getColumns() validates that a non-blank table name was supplied before running GetHiveColumns against HiveServer2. An empty or whitespace-only table name cannot be resolved to column metadata, so the call is rejected up front with this error.

Source

Thrown at agents/drivers/hive-go/metadata.go:608

		}
	}
	return false
}

// acceptsRoutineType reports whether the requested object types include the
// given routine kind (case-insensitive).
func acceptsRoutineType(objectTypes []string, routineType string) bool {
	for _, objectType := range objectTypes {
		if strings.EqualFold(objectType, routineType) {
			return true
		}
	}
	return false
}

func (server *server) getColumns(schema, table string) ([]columnInfo, error) {
	if strings.TrimSpace(table) == "" {
		return nil, errors.New("table is required")
	}
	schema = firstNonEmpty(schema, server.config.Database)
	metadataResult, metadataErr := server.hiveMetadata(func(ctx context.Context, provider gohive.MetadataProvider) (gohive.MetadataResult, error) {
		return provider.GetHiveColumns(ctx, schema, table, "%")
	})
	if metadataErr == nil {
		rows := newHiveMetadataRows(metadataResult)
		values := make([]columnInfo, 0, len(rows.rows))
		for _, row := range rows.rows {
			name := metadataString(rows.value(row, "COLUMN_NAME"))
			if name == "" {
				continue
			}
			dataType := metadataString(rows.value(row, "TYPE_NAME"))
			columnSize := metadataIntPointer(rows.value(row, "COLUMN_SIZE"))
			values = append(values, columnInfo{
				Name:                   name,
				DataType:               dataType,

View on GitHub (pinned to c0390bff16)

Solutions

  1. Pass a non-empty table name to the getColumns call.
  2. Trim and validate the table parameter at the client/request boundary before invoking the driver.
  3. Verify upstream code that derives the table name (parser, router) actually populates it for this request.
  4. If you need all columns without a table, list tables first and then query columns per table.

Example fix

// before
getColumns("default", "") // error: table is required
// after
if strings.TrimSpace(tableName) == "" {
    return errors.New("client: table name must be provided")
}
getColumns("default", tableName)
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(table) == "" {
    return errors.New("table name is required for getColumns")
}

Try / catch

cols, err := srv.GetColumns(schema, table)
if err != nil && strings.Contains(err.Error(), "table is required") {
    return fmt.Errorf("caller bug: empty table for getColumns (schema=%q)", schema)
}

Prevention

When it happens

Trigger: Calling getColumns / the dispatch getColumns entry point with table="" or table=" " (schema may be empty — it defaults to config.Database — but table must be set).

Common situations: Client UI or ORM passes an empty table identifier because a previous listing step failed; JSON request omits the "table" field; dynamic SQL generation produces blank table names on empty inputs.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05). Data as JSON: /api/errors/344d488fbc12e72b. Report an issue: GitHub.