khangtruong113 opened a new pull request, #71458: URL: https://github.com/apache/doris/pull/71458
### Background dbt-doris creates tables with CTAS. Doris infers physical column nullability from the query, including when a model declares data types in its properties file. ### What problem does this PR solve? Issue Number: close #71457 Related PR: None PR Type: Feature Problem Summary: Model authors can declare required and nullable columns on tables and incremental destinations. The adapter loads the declared schema before publishing the result, so a failed initial load or rebuild cannot publish an empty replacement. ### Details - **Scope:** Initial builds and rebuilds of table and incremental models. - **Design:** Read dbt column constraints and column metadata. For declarations that leave a type or nullability unspecified, use a session-local zero-row CTAS to ask Doris for its inferred schema. Load a uniquely named table and rename it after successful insertion. - **Usage:** Declare a not_null constraint or set config.meta.doris.nullable to true on a column. Conflicting declarations produce a compilation error. - **Default behavior:** Models without declarations retain their CTAS path. - **Compatibility:** Existing incremental schemas can be updated via full refresh. Input validation on insert follows the server's insert mode. - **Behavior change:** Models that opt in receive the configured physical layout. ### Testing Ran the adapter functional suite on single-node Apache Doris 4.1.5, Python 3.12 and dbt-core 1.10.4. All 37 cases passed. The new cases verify physical schema, failed initial loads, successful incremental reruns, failed full refreshes that preserve the previous data, and conflicting YAML. ### Release note Table and incremental models can declare physical column nullability using their properties YAML. ### Check List (For Author) - Behavior changed: Yes (opt-in column settings). - 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]
