Skip to content

Commit 66becfa

Browse files
leoyvenstobixdev
authored andcommitted
make Union::try_new pub (apache#18125)
## Which issue does this PR close? - Closes apache#18126. ## Rationale for this change It's a useful constructor for users manipulating logical plans where they know the schemas will match exactly. We already expose other constructors for Union and constructors for logical plans. ## What changes are included in this PR? Makes `Union::try_new` a public function. ## Are these changes tested? Seems unnecessary. ## Are there any user-facing changes? The function is now public. Not a breaking change, but going forward changes to it would breaking changes to users of the logical plan API.
1 parent 345b31c commit 66becfa

File tree

1 file changed

+2
-1
lines changed
  • datafusion/expr/src/logical_plan

1 file changed

+2
-1
lines changed

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2753,7 +2753,8 @@ pub struct Union {
27532753

27542754
impl Union {
27552755
/// Constructs new Union instance deriving schema from inputs.
2756-
fn try_new(inputs: Vec<Arc<LogicalPlan>>) -> Result<Self> {
2756+
/// Schema data types must match exactly.
2757+
pub fn try_new(inputs: Vec<Arc<LogicalPlan>>) -> Result<Self> {
27572758
let schema = Self::derive_schema_from_inputs(&inputs, false, false)?;
27582759
Ok(Union { inputs, schema })
27592760
}

0 commit comments

Comments
 (0)