Skip to content

Apache DataFusion SQL Query Engine

fix doc and broken api (#15602)

logan-keede64889c0d4ea5
diff --git a/datafusion/common/src/functional_dependencies.rs b/datafusion/common/src/functional_dependencies.rs
index 5f262d634a..c4f2805f82 100644
--- a/datafusion/common/src/functional_dependencies.rs
+++ b/datafusion/common/src/functional_dependencies.rs
@@ -47,11 +47,13 @@ impl Constraints {
Constraints::new_unverified(vec![])
}
- /// Create a new `Constraints` object from the given `constraints`.
- /// Users should use the `empty` or `new_from_table_constraints` functions
- /// for constructing `Constraints`. This constructor is for internal
+ /// Create a new [`Constraints`] object from the given `constraints`.
+ /// Users should use the [`Constraints::empty`] or [`SqlToRel::new_constraint_from_table_constraints`] functions
+ /// for constructing [`Constraints`]. This constructor is for internal
/// purposes only and does not check whether the argument is valid. The user
- /// is responsible for supplying a valid vector of `Constraint` objects.
+ /// is responsible for supplying a valid vector of [`Constraint`] objects.
+ ///
+ /// [`SqlToRel::new_constraint_from_table_constraints`]: https://docs.rs/datafusion/latest/datafusion/sql/planner/struct.SqlToRel.html#method.new_constraint_from_table_constraints
pub fn new_unverified(constraints: Vec<Constraint>) -> Self {
Self { inner: constraints }
}
diff --git a/datafusion/sql/src/statement.rs b/datafusion/sql/src/statement.rs
index fc6cb0d32f..9685e55a06 100644
--- a/datafusion/sql/src/statement.rs
+++ b/datafusion/sql/src/statement.rs
@@ -1547,7 +1547,7 @@ impl<S: ContextProvider> SqlToRel<'_, S> {
}
/// Convert each [TableConstraint] to corresponding [Constraint]
- fn new_constraint_from_table_constraints(
+ pub fn new_constraint_from_table_constraints(
&self,
constraints: &[TableConstraint],
df_schema: &DFSchemaRef,