khangtruong113 opened a new pull request, #71460:
URL: https://github.com/apache/doris/pull/71460
### Background
The dbt adapter creates Doris tables from model queries. Its partition
options currently render a partition type, raw expressions and optional initial
partitions.
### What problem does this PR solve?
Issue Number: close #71459
Related PR: None
PR Type: Feature
Problem Summary:
Users can configure daily range partitions and multi-column list partitions
in model YAML. The adapter validates the shape and renders the matching Doris
clause, preserving the existing manual partition path. Incremental staging
tables carry the batch without the destination partition clause.
### Details
- **Scope:** Table creation in the dbt adapter.
- **Design:** One mapping specifies a range column and date_trunc unit or a
list of column names. Mixing manual and automatic partition settings raises a
compilation error.
- **Usage:** Set auto_partition to {type: range, column: event_day,
granularity: day} or {type: list, columns: [region, event_day]}.
- **Default behavior:** Omitted by default.
- **Compatibility:** Existing partition configurations continue through the
original macro. Doris validates column types and range column nullability.
- **Behavior change:** Models that opt in receive the configured physical
layout.
### Testing
Ran the adapter functional suite on a single-node Doris 4.1.5 cluster with
Python 3.12 and dbt-core 1.10.4. All 38 cases passed. Tests cover two batches
that create partitions, reuse of an existing partition, manual partitioning and
invalid configurations.
### Release note
dbt-doris supports model-level automatic range and list partition
configuration.
### Check List (For Author)
- Behavior changed: Yes (new opt-in configuration).
- Does this need documentation: Yes, adapter README included.
- Pre-submission status: Ready.
### AI Disclosure
- Tool: OpenAI Codex
- Generated: Implementation, tests, README and PR description.
- Human review: The author reviewed the proposed YAML interface. Code and
tests were reviewed and run by Codex.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]