Standing-Man commented on code in PR #19672:
URL: https://github.com/apache/datafusion/pull/19672#discussion_r2671329810


##########
datafusion/sql/src/statement.rs:
##########
@@ -102,78 +103,72 @@ fn get_schema_name(schema_name: &SchemaName) -> String {
 /// Construct `TableConstraint`(s) for the given columns by iterating over
 /// `columns` and extracting individual inline constraint definitions.
 fn calc_inline_constraints_from_columns(columns: &[ColumnDef]) -> 
Vec<TableConstraint> {
-    let mut constraints = vec![];
+    let mut constraints: Vec<TableConstraint> = vec![];
     for column in columns {
         for ast::ColumnOptionDef { name, option } in &column.options {
             match option {
-                ast::ColumnOption::Unique {
-                    is_primary: false,
-                    characteristics,
-                } => constraints.push(TableConstraint::Unique {
-                    name: name.clone(),
-                    columns: vec![IndexColumn {
-                        column: OrderByExpr {
-                            expr: SQLExpr::Identifier(column.name.clone()),
-                            options: OrderByOptions {
-                                asc: None,
-                                nulls_first: None,
+                ast::ColumnOption::Unique(constraint) => {

Review Comment:
   
https://docs.rs/sqlparser/0.60.0/sqlparser/ast/table_constraints/enum.TableConstraint.html
   https://docs.rs/sqlparser/0.59.0/sqlparser/ast/enum.TableConstraint.html
   
   I see! `Unique(constraint)` is flexible, so new fields can be added 
unnoticed at compile time, but that’s the same as it was before.



-- 
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]

Reply via email to