Skip to content

Fixes #37590: Doris CHAR(255) columns dropped during metadata ingestion - #37591

Merged
akashverma0786 merged 3 commits into
open-metadata:mainfrom
morningman:doris-character-type
Nov 23, 2026
Merged

akashverma0786 merged 3 commits into
open-metadata:mainfrom
morningman:doris-character-type

Conversation

@morningman

@morningman morningman commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37590

Doris prints a CHAR(255) column, and a CHAR without a length such as a view column defined as CAST(x AS CHAR), as character(255) in SHOW FULL COLUMNS. _get_column in the Doris connector kept that name, so these columns got the data type CHARACTER, which is not a DataType, and were skipped with a warning; ARRAY<CHAR(255)> columns got CHARACTER as their element type. This change reads character(N) as char(N) before the type is parsed, so these columns map to CHAR with length N, and dataTypeDisplay keeps the text Doris printed.

The generic ColumnTypeParser already maps CHARACTER to CHAR, but the Doris connector types its columns through its own _parse_type and pydoris's parse_sqltype, and neither knows character (pydoris returns NullType). Normalizing the type text once covers both, and the other Doris types map as before. Only a character followed by ( is rewritten, so a STRUCT field named character keeps its name.

Part of #37537. #37551 changes the neighbouring _parse_type in the same file; the two changes don't overlap.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Metadata ingestion of a Doris table with CHAR(255) and ARRAY<CHAR(255)> columns, and of a view column defined as CAST(x AS CHAR), keeps those columns: CHAR with length 255, and an ARRAY of CHAR.
  • char(N) columns are unchanged, and a STRUCT field named character keeps its name.

Unit tests

  • I added unit tests for the new/changed logic.
  • Files added/updated: ingestion/tests/unit/source/database/doris/test_doris_character_type.py
    • a table-driven test of _get_column for character(255) and char(10), plus array<character(255)> and a STRUCT with a field named character;
    • a test that runs DorisSource.get_columns_and_constraints on SHOW FULL COLUMNS rows from Doris (only the database connection is replaced) and checks that the CHAR(255) columns are ingested with dataLength 255.
  • On main, 3 of these 5 tests fail (character(255), array<character(255)>, and the ingestion test); with this change they all pass. Fixes #37539: Doris ipv4/ipv6 columns dropped during metadata ingestion #37551 adds a table-driven test of the same function; whichever of the two lands second can fold these cases into it.
  • make unit_ingestion ARGS="-n 0 tests/unit/source/database/doris tests/unit/topology/database/test_doris.py": 29 passed.
  • Coverage %: 74% on doris/metadata.py; the changed lines in _get_column are covered (its only uncovered lines are the existing DECIMAL branch).

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

  1. Started a local Apache Doris master build (6991e766329) with a table of CHAR(10), CHAR(255) and ARRAY<CHAR(255)> columns and a view with CAST(c_char_10 AS CHAR).
  2. Ran the Doris source's yield_table against it with a mocked OpenMetadata client, before and after this change:
    • before (main): the table kept 2 of its 4 columns and the view 1 of its 3, with Unexpected exception processing column warnings (input_value='CHARACTER');
    • after: all columns ingested, c_char_255 and the view's c_cast_char as CHAR with length 255 and dataTypeDisplay character(255), c_arr_char_255 as an ARRAY of CHAR; the other tables in the database are unchanged.
  3. make py_format_check and make static-checks pass (0 errors).

UI screen recording:

Not applicable — ingestion-only bug fix with no UI change.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. (N/A: no schema change)

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable). (N/A: not a UI change)

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md and fixed every 🔴 finding, or answered it on the line below.

  • Decision check: if this PR decides something the next contributor could undo, it adds a record under docs/decisions/. (N/A: bug fix, no durable decision)

  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Fixes Doris columns reported as character(N) by parsing them as char(N) while keeping the original top-level display text.

  • Doris character columns now reach metadata as CHAR.

Reviews (2) · Last reviewed commit: "Merge branch 'main' into doris-character..." · Reviewed by Greptile

Doris prints a CHAR(255) column, and a CHAR without a length such as
CAST(x AS CHAR), as "character(255)" in SHOW FULL COLUMNS. _get_column
passed the name through, so those columns got the data type CHARACTER,
which is not a DataType, and were skipped with a warning; ARRAY<CHAR(255)>
columns got CHARACTER as their element type. Read character(N) as char(N)
before the type is parsed, and keep the text Doris printed for display.
@morningman
morningman requested a review from a team as a code owner November 11, 2026 15:36
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@morningman

Copy link
Copy Markdown
Contributor Author

hi @TeddyCr could you please help to review this?

@akashverma0786 akashverma0786 added the safe to test Add this label to run secure Github workflows on PRs label Nov 20, 2026
@gitar-bot

gitar-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Normalizing Doris character(N) types changes column metadata ingestion; an incorrect parse could catalog affected columns with inaccurate CHAR types or lengths.

Normalizes Doris character(N) column types to char(N) before parsing, so CHAR(255), ARRAY<CHAR(255)> and CAST(x AS CHAR) view columns are ingested as CHAR with the correct length instead of being dropped. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@akashverma0786
akashverma0786 merged commit 980ee10 into open-metadata:main Nov 23, 2026
49 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doris: CHAR(255) columns are silently dropped during metadata ingestion

3 participants