Repository navigation
feat: add builders for CreateExternalCatalog and DropCatalog - #25785
Merged
Merged
Conversation
TTyChud
force-pushed
the
feat/catalog-builders
branch
from
September 27, 2026 01:40
4cac198 to
8006aed
Compare
martin-g
reviewed
Sep 29, 2026
martin-g
left a comment
Member
There was a problem hiding this comment.
Please add some unit tests for the new builders.
Adds builder APIs for the two catalog DDL structs, mirroring the CreateExternalTable builder added in apache#19066, and rewires the CREATE EXTERNAL CATALOG and DROP CATALOG/DROP DATABASE construction sites in datafusion-sql. Closes apache#25627.
TTyChud
force-pushed
the
feat/catalog-builders
branch
from
October 1, 2026 06:11
8006aed to
c9a020e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25785 +/- ##
========================================
Coverage 82.58% 82.58%
========================================
Files 1145 1145
Lines 443655 443783 +128
Branches 443655 443783 +128
========================================
+ Hits 366401 366513 +112
- Misses 55004 55018 +14
- Partials 22250 22252 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
martin-g
approved these changes
Oct 1, 2026
Contributor
Author
|
I dont think there's a problem with my code can u plz rerun it |
alamb
approved these changes
Oct 1, 2026
| )), | ||
| ObjectType::Database => { | ||
| Ok(LogicalPlan::Ddl(DdlStatement::DropCatalog( | ||
| DropCatalog::builder(object_name_to_string(&name)) |
alamb
enabled auto-merge
October 1, 2026 17:38
Omega359
pushed a commit
to Omega359/arrow-datafusion
that referenced
this pull request
Oct 11, 2026
…che#25785) ## Which issue does this PR close? - Closes apache#25627. ## Rationale for this change These two structs can only be built by setting all seven fields by hand, including a `schema` field that is always empty. The builders let you set only what you need, the same way `CreateExternalTable::builder` already does. ## What changes are included in this PR? - Adds `CreateExternalCatalog::builder` and `DropCatalog::builder`, with `must_use` `with_*` setters and `build()`. - Uses them in `CREATE EXTERNAL CATALOG`, `DROP CATALOG` and `DROP DATABASE` (`datafusion/sql/src/statement.rs`). ## What is the testing strategy for this PR? - 5 unit tests in `datafusion/expr/src/logical_plan/ddl.rs` covering the builder defaults, every `with_*` setter, and that `with_location(None)` unsets the location. - New doc examples on both builders, run by `cargo test -p datafusion-expr --doc`. - `cargo fmt --all -- --check`, `cargo test -p datafusion-expr --lib ddl::test` and `cargo clippy -p datafusion-expr -p datafusion-sql --all-targets --no-deps -- -D warnings` pass locally. - Existing catalog tests are unchanged. ## Are there any user-facing changes? Two new public builders. Nothing removed or changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
CreateExternalCatalogandDropCatalog#25627.Rationale for this change
These two structs can only be built by setting all seven fields by hand, including
a
schemafield that is always empty. The builders let you set only what youneed, the same way
CreateExternalTable::builderalready does.What changes are included in this PR?
CreateExternalCatalog::builderandDropCatalog::builder, withmust_usewith_*setters andbuild().CREATE EXTERNAL CATALOG,DROP CATALOGandDROP DATABASE(
datafusion/sql/src/statement.rs).What is the testing strategy for this PR?
datafusion/expr/src/logical_plan/ddl.rscovering the builderdefaults, every
with_*setter, and thatwith_location(None)unsets the location.cargo test -p datafusion-expr --doc.cargo fmt --all -- --check,cargo test -p datafusion-expr --lib ddl::testandcargo clippy -p datafusion-expr -p datafusion-sql --all-targets --no-deps -- -D warningspass locally.
Are there any user-facing changes?
Two new public builders. Nothing removed or changed.