Skip to content

Doris: key columns are mapped to PRIMARY KEY incorrectly and composite keys are lost #37541

Done

Description

@morningman

Connector

Doris

Feature area

Metadata ingestion

Describe the bug

The connector marks a column as PRIMARY KEY when SHOW FULL COLUMNS reports Key=YES. In Doris that flag covers:

  • the key columns of all models, including DUPLICATE KEY sort keys, which are not unique;
  • every column of an external table.

With more than one key column, the column-level constraint becomes None, NOT NULL is lost, and no table-level constraint is emitted.

To Reproduce

  1. Create a UNIQUE KEY table with a composite key (region, user_id) and a DUPLICATE KEY table.
  2. Run metadata ingestion.
  3. The UNIQUE table has no table-level constraint and its key columns lose NOT NULL; the DUPLICATE table's first sort key column is marked PRIMARY KEY.

Expected behavior

Read TABLE_MODEL and TABLE_MODEL_KEY from information_schema.table_options. Emit a table-level PRIMARY KEY for UNIQUE (and AGGREGATE) models only, and keep NOT NULL on key columns.

Connection / ingestion config

No response

Logs

No response

OS

macOS (arm64)

Python version

3.12

OpenMetadata version

main (1e55df4) and 2.0.7.2

OpenMetadata Ingestion package version

2.0.7.2 and main (1e55df4)

Additional context

Part of #37537. Reproduced with openmetadata-ingestion 2.0.7.2 and main (1e55df4) against Apache Doris master (6991e766329).

Pre-submission checklist

  • I searched for duplicate issues.
  • I removed credentials, hostnames, emails, and other sensitive data from logs and config.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    fb5e8e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done ✅

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions