iffyio commented on code in PR #1900: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1900#discussion_r2160246517
########## src/parser/mod.rs: ########## @@ -10595,6 +10593,16 @@ impl<'a> Parser<'a> { self.parse_parenthesized_column_list_inner(optional, allow_empty, |p| p.parse_identifier()) } + /// Parses a parenthesized comma-separated list of index columns, which can be arbitrary + /// expressions with ordering information (and an opclass in some dialects). + pub fn parse_parenthesized_index_column_list( Review Comment: ```suggestion fn parse_parenthesized_index_column_list( ``` We can have this within the crate unless it would be required/useful to export? ########## src/parser/mod.rs: ########## @@ -16476,6 +16484,22 @@ mod tests { }}; } + macro_rules! mk_expected_col { + ($name:expr) => { + IndexColumn { + column: OrderByExpr { + expr: Expr::Identifier($name.into()), + options: OrderByOptions { + asc: None, + nulls_first: None, + }, + with_fill: None, + }, + operator_class: None, + } + }; + } Review Comment: Would it make more sense to use a function for this instead? since macros aren't the best for readability ########## src/test_utils.rs: ########## @@ -448,3 +448,47 @@ pub fn call(function: &str, args: impl IntoIterator<Item = Expr>) -> Expr { within_group: vec![], }) } + +/// Gets the first index column (mysql calls it a key part) of the first index a CREATE INDEX, +/// CREATE TABLE, or ALTER TABLE statement. Review Comment: ```suggestion /// Gets the first index column (mysql calls it a key part) of a [Statement::CreateIndex], [Statement::CreateTable] or [Statement::AlterTAble] ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org