Repository navigation
Fixes #37590: Doris CHAR(255) columns dropped during metadata ingestion - #37591
Conversation
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.
❌ PR checklist incompleteThis 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 |
|
hi @TeddyCr could you please help to review this? |
Code Review ✅ Approved 🟡 Medium riskNormalizing Doris character(N) types changes column metadata ingestion; an incorrect parse could catalog affected columns with inaccurate CHAR types or lengths. Normalizes Doris VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #37590
Doris prints a
CHAR(255)column, and aCHARwithout a length such as a view column defined asCAST(x AS CHAR), ascharacter(255)inSHOW FULL COLUMNS._get_columnin the Doris connector kept that name, so these columns got the data typeCHARACTER, which is not aDataType, and were skipped with a warning;ARRAY<CHAR(255)>columns gotCHARACTERas their element type. This change readscharacter(N)aschar(N)before the type is parsed, so these columns map toCHARwith length N, anddataTypeDisplaykeeps the text Doris printed.The generic
ColumnTypeParseralready mapsCHARACTERtoCHAR, but the Doris connector types its columns through its own_parse_typeand pydoris'sparse_sqltype, and neither knowscharacter(pydoris returnsNullType). Normalizing the type text once covers both, and the other Doris types map as before. Only acharacterfollowed by(is rewritten, so aSTRUCTfield namedcharacterkeeps its name.Part of #37537. #37551 changes the neighbouring
_parse_typein the same file; the two changes don't overlap.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
CHAR(255)andARRAY<CHAR(255)>columns, and of a view column defined asCAST(x AS CHAR), keeps those columns:CHARwith length 255, and anARRAYofCHAR.char(N)columns are unchanged, and aSTRUCTfield namedcharacterkeeps its name.Unit tests
ingestion/tests/unit/source/database/doris/test_doris_character_type.py_get_columnforcharacter(255)andchar(10), plusarray<character(255)>and aSTRUCTwith a field namedcharacter;DorisSource.get_columns_and_constraintsonSHOW FULL COLUMNSrows from Doris (only the database connection is replaced) and checks that theCHAR(255)columns are ingested withdataLength255.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.doris/metadata.py; the changed lines in_get_columnare covered (its only uncovered lines are the existingDECIMALbranch).Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
CHAR(10),CHAR(255)andARRAY<CHAR(255)>columns and a view withCAST(c_char_10 AS CHAR).yield_tableagainst it with a mocked OpenMetadata client, before and after this change:main): the table kept 2 of its 4 columns and the view 1 of its 3, withUnexpected exception processing columnwarnings (input_value='CHARACTER');c_char_255and the view'sc_cast_charasCHARwith length 255 anddataTypeDisplaycharacter(255),c_arr_char_255as anARRAYofCHAR; the other tables in the database are unchanged.make py_format_checkandmake static-checkspass (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.mdand 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.


Confidence Score: 5/5
The PR appears safe to merge.Summary
Fixes Doris columns reported as
character(N)by parsing them aschar(N)while keeping the original top-level display text.Reviews (2) · Last reviewed commit: "Merge branch 'main' into doris-character..." · Reviewed by Greptile