iffyio commented on code in PR #1747: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1747#discussion_r2010074470
########## 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: The downside is that there's a bit of code and API to power and maintain in any case, not isolated to the dialect's parsing, the keyword list and the AST are affected as well. But it also implies that we have to model and keep up with all options across all dialects in order to be correct/consistent going forward which would be a bigger ask. -- 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