tv42 opened a new issue, #7511:
URL: https://github.com/apache/arrow-datafusion/issues/7511
### Describe the bug
DataFusion v29.0.0 added commit 5f031465447e60d482d5236e2795f7975bbfe45d,
which contains this change:
```diff
diff --git a/datafusion/expr/src/logical_plan/ddl.rs
b/datafusion/expr/src/logical_plan/ddl.rs
index e005f1147..dc247da36 100644
--- a/datafusion/expr/src/logical_plan/ddl.rs
+++ b/datafusion/expr/src/logical_plan/ddl.rs
@@ -222,8 +217,8 @@ impl Hash for CreateExternalTable {
pub struct CreateMemoryTable {
/// The table name
pub name: OwnedTableReference,
- /// The ordered list of columns in the primary key, or an empty vector
if none
- pub primary_key: Vec<Column>,
+ /// The list of constraints in the schema, such as primary key, unique,
etc.
+ pub constraints: Constraints,
/// The logical plan
pub input: Arc<LogicalPlan>,
/// Option to not error if table already exists
```
So, previously, `primary_key` was just a `Vec`, and `Column` was public. Now
it's `Constraints`, and `Constraints` has only private fields and no accessor
methods:
https://docs.rs/datafusion/latest/datafusion/common/struct.Constraints.html
Previously, I could take a logical plan and introspect it. Now I can't.
Can we make `Constraint` public, and either make the inner of `Constraints`
public, or add an accessor method?
The change should be pretty simple, but I'm trying to understand the
thinking behind the current API.
Cc @mustafasrepo @metesynnada @ozankabak
### To Reproduce
```rust
let statement = session_state.sql_to_statement(sql, sql_dialect)?;
let logical_plan = session_state.statement_to_plan(statement).await?;
match logical_plan {
datafusion::logical_expr::LogicalPlan::Ddl(
datafusion::logical_expr::DdlStatement::CreateMemoryTable(create_table),
) => {
for key in &create_table.primary_key {
println!("key {} ref {:?}", key.name, key.relation);
}
_ => (),
}
```
### Expected behavior
Be able to introspect the LogicalPlan.
### Additional context
_No response_
--
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]