tomershaniii commented on code in PR #1747:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1747#discussion_r2009102876
##########
src/parser/mod.rs:
##########
@@ -6928,13 +6874,122 @@ impl<'a> Parser<'a> {
};
}
+ let plain_options = self.parse_plain_options()?;
+
Ok(CreateTableConfiguration {
partition_by,
cluster_by,
options,
+ plain_options,
})
}
+ fn parse_plain_option(&mut self) -> Result<Option<SqlOption>, ParserError>
{
+ if let Some(option) = self.dialect.parse_plain_option(self)? {
+ return Ok(Some(option));
+ }
+
+ // Parse table options in any order
+ if let Some(keyword) = self.parse_one_of_keywords(&[
+ Keyword::ENGINE,
+ Keyword::AUTO_INCREMENT,
+ Keyword::DEFAULT,
+ Keyword::CHARSET,
+ Keyword::COLLATE,
+ Keyword::INSERT_METHOD,
+ ]) {
Review Comment:
It's a bigger question if the library should branch out to dialect specific
parsing or maintain common code supporting all dialects, looking at
`SnowflakeDialect` is seems like a specific implementation exists
(`parse_create_table`) and looking at the common code i can see several places
where the code diverges based on dialect (mostly hive related).
Having `parse_create_table` as part of the dialect is what guided the
decision to pull this code in, I may have overlooked `ENGINE` and
`AUTO_INCREMENT`, prefer to pull those into mysql code rather than take mysql
code out.
LMKWYT
--
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]