Repository navigation
Fixes #37542: Doris partitions follow the partition method and column type - #37686
Conversation
The Doris connector ran SHOW PARTITIONS for every table, views included, on a connection of its own, and reported every partition column as TIME-UNIT without an interval. Read information_schema.tables joined with information_schema.partitions once per schema instead. LIST partition columns are COLUMN-VALUE; a RANGE partition column is TIME-UNIT on a DATE or DATETIME column and INTEGER-RANGE on an integer one. For an OLAP table that is RANGE partitioned or has no partition row, SHOW CREATE TABLE gives the unit of an AUTO PARTITION date_trunc or of a dynamic partition, and the partition columns of a table without partitions.
❌ 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 |
Resolve the Doris connector conflicts with open-metadata#37705 and open-metadata#37706: read the DDL through _get_create_statement, and keep a failing per-table partition lookup from dropping the table (it returns no partition details instead).
A table whose DDL or columns cannot be read is ingested without partition details. The ADR now records how Doris reports LIST and RANGE partitions.
A lost connection leaves the thread's connection refusing every statement until it is rolled back, so the next tables would fail with PendingRollbackError instead of only losing their partition details.
Code Review ✅ Approved 🟡 Medium risk 2 closed / 2 findingsDoris partition classification changes profiler date windows and integer ranges, so misclassified keys could cause profiles to omit or include unintended data. Doris partition details now come from ✅ 2 closed✅ Bug: Partition lookup errors now drop the table, and it can be marked deleted
✅ Quality: Doris partition-type mapping rule recorded only in the PR description
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 |
|
hi @Khairajani , thanks for your review! |
Describe your changes:
Fixes #37542
The Doris connector read partition details with one
SHOW PARTITIONSper table, on a connection checked out of the pool for that call, took thePartitionKeyof the first row and reported every partition column asTIME-UNITwithout an interval. So LIST partitions and RANGE partitions on integer columns were reported as time units, AUTO and dynamic partitions lost their unit, a table with no partition yet (an AUTO PARTITION table before its first load) was reported as unpartitioned, andSHOW PARTITIONSran on every view, where Doris rejects it.This change:
information_schema.tablesjoined withinformation_schema.partitionsonce per schema. The result is kept in an LRU cache with one entry per ingestion thread, since each of thethreadsworkers ingests its own schema.PARTITION_METHODtells LIST from RANGE; views, unpartitioned tables and LIST tables need no further query.COLUMN-VALUE.TIME-UNITwhen it is a DATE or DATETIME andINTEGER-RANGEwhen it is an integer, the only RANGE partition types Doris allows. The column types are the ones the connector already parses fromSHOW FULL COLUMNS.SHOW CREATE TABLEgives theinterval: the unit ofAUTO PARTITION BY RANGE (date_trunc(col, 'unit'))ordynamic_partition.time_unit(DAY,MONTH, ...). It also names the partition columns of a table without partitions.SHOW CREATE TABLErefuses materialized views, so they get no interval.information_schema.partitionshas no rows: every OLAP table then takes theSHOW CREATE TABLEpath, and a table without a partition clause is unpartitioned.With partition auto-detection on (ADR:2026-10-16-profiler-auto-detects-partitions-only-for-declared-services), this changes what the profiler scopes:
INTEGER-RANGE, so their column metrics use the default 1–10000 range; before, the detection skipped them and profiled the whole table. A table partitioned on an integer date key such as20260101needs its partitioning set in the table profiler config, or auto-detection turned off.COLUMN-VALUEand are no longer scoped to the last 3 days.A materialized view with no partition yet is reported as unpartitioned: Doris lists no partition row for it, and its DDL names the partition column without RANGE or LIST. It is picked up once its first partition exists.
Part of #37537.
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
COLUMN-VALUEpartitions.TIME-UNITwithout an interval; on an integer column,INTEGER-RANGE; on(dt, id), one of each.AUTO PARTITION BY RANGE (date_trunc(ts, 'day'))and a dynamic partition withtime_unit = DAYgetTIME-UNITwith intervalDAY.MONTH.TIME-UNIT/INTEGER-RANGEby column type.Unit tests
ingestion/tests/unit/source/database/doris/test_doris_partitions.pyDorisSource.get_table_partition_detailson real rows from Doris master (information_schema.tablesjoined withinformation_schema.partitions,SHOW CREATE TABLE,SHOW FULL COLUMNS; only the database connection is replaced), one case per partition shape;information_schema.partitionshas no rows;main, all 28 tests fail; with this change they all pass.make unit_ingestion ARGS="-n 0 tests/unit/source/database/doris tests/unit/topology/database/test_doris.py": 52 passed.doris/metadata.py; every line and branch of the new code is covered, the uncovered lines predate this change.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Started a local Apache Doris master build with test databases covering LIST (single, multi-column, AUTO), RANGE (DATE, integer, multi-column, AUTO with
date_trunc, dynamic), an AUTO PARTITION table without partitions, unpartitioned tables, views and asynchronous materialized views (unpartitioned, RANGE on a date, RANGE on an integer, without partitions).Ran the Doris source's
yield_tableagainst it with a mocked OpenMetadata client, before and after this change:t_uniqLIST (region)t_list_multiLIST (region, city)t_auto_listAUTO LIST (city)t_typesRANGE (k_date DATE)t_autoAUTO RANGEdate_trunc(ts, 'day')t_dyndynamic partition, DAYt_range_intRANGE (id INT)t_range_multiRANGE (dt, id)t_auto_emptyAUTO RANGEdate_trunc(ts, 'month'), no partitionmv_dyn/mv_monthMV RANGE (dt DATE)mv_range_intMV RANGE (id INT)Views, unpartitioned tables and the materialized view without partitions stay unpartitioned; nothing else in the output changed.
Doris's audit log for the same runs, schema
om_verify(13 tables and views): before, 72 statements, including 13SHOW PARTITIONS(4 of them on views, which fail) and 14ROLLBACKs from returning the per-call connections; after, 48 statements: one partition query,SHOW CREATE TABLEandSHOW FULL COLUMNSfor the 2 RANGE tables, noSHOW PARTITIONS.An account with only
SELECT_PRIVgets the same partition details.make py_format_checkandmake static-checkspass (0 errors, no new warnings).Repeated steps 2 to 4 on Doris 4.1.3 (
apache/doris:all-in-one-4.1.3): every table gets the same partition details as on master, before and after this change, with the same statement counts.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; the profiler scoping follows ADR:2026-10-16-profiler-auto-detects-partitions-only-for-declared-services)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 follow-up appears safe to merge; the previous connection recovery issue is addressed.Summary
Doris now reports partitions by their method and column type, including AUTO and dynamic time units. The follow-up fixes connection recovery after failed partition queries.
The previous finding is addressed. No new actionable issues were found.
Reviews (2) · Last reviewed commit: "Roll back the Doris connection after a f..." · Reviewed by Greptile