Standing-Man commented on code in PR #19672:
URL: https://github.com/apache/datafusion/pull/19672#discussion_r2674563877
##########
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:
Got it! I will update on next commit.
--
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]