iffyio commented on code in PR #1747: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1747#discussion_r1992143879
########## src/ast/mod.rs: ########## @@ -6925,6 +6928,12 @@ pub enum SqlOption { range_direction: Option<PartitionRangeDirection>, for_values: Vec<Expr>, }, + + TableSpace(TablespaceOption), + + Union(Vec<Ident>), + + TableEngine(TableEngine), Review Comment: Could we add a description (ideally with syntax example) and links to the docs where these variants come from? ########## src/dialect/mysql.rs: ########## @@ -141,6 +149,280 @@ impl Dialect for MySqlDialect { fn supports_set_names(&self) -> bool { true } + /// Dialect-specific table/view option parser override + /// + /// This method is called to parse the next table/view option. + /// + /// If `None` is returned, falls back to the default behavior. + /// <https://dev.mysql.com/doc/refman/8.4/en/create-table.html> + fn parse_plain_option(&self, parser: &mut Parser) -> Result<Option<SqlOption>, ParserError> { + //Some consts + const COMPRESSION_OPTS: [&str; 3] = ["ZLIB", "LZ4", "NONE"]; + const INSERT_METHODS_OPTS: [&str; 3] = ["NO", "FIRST", "LAST"]; + + let keyword = match parser.parse_one_of_keywords(&[ Review Comment: to clarify my [comment here](https://github.com/apache/datafusion-sqlparser-rs/pull/1747#discussion_r1972915911) my thinking is that the options are plain key value pairs and idealy would be parsed as such. So that I imagined the parser shouldnt look for explicit keywords, similar to other dialects like bigquery it only looks to parse a key and a value. Essentially, that it looks to parse and represent something like this I was thinking ```rust SqlOption::Plain { // Similar to SqlOption::KeyValue except it doesnt format with = key: Ident, value: Expr, } ``` -- 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