Support mysql partition to table selection#959
Conversation
f2b7af9 to
d441f7d
Compare
|
@alamb PTAL |
|
Sorry for the delay -- I was away last week. I am looking at this PR now |
alamb
left a comment
There was a problem hiding this comment.
Thank you for the contribution @chunshao90 -- this is looking pretty close. I left some suggestions for your consideration
| let partitions = if dialect_of!(self is MySqlDialect) | ||
| && self.parse_keyword(Keyword::PARTITION) | ||
| { | ||
| let mut partitions = self.parse_comma_separated(|p| p.parse_tuple(true, false))?; |
There was a problem hiding this comment.
As written I think this only checks the first partition for having more than one tuple element (what about values after index 0?)
I think if you used parse_expr here this code would be significantly simpler and there would be no need for error checking
| let mut partitions = self.parse_comma_separated(|p| p.parse_tuple(true, false))?; | |
| let mut partitions = self.parse_comma_separated(Parser::parse_expr)?; |
There was a problem hiding this comment.
Returns an error if there are multiple tuples.
f287cec to
f3f5c9e
Compare
|
@alamb Please review again. |
alamb
left a comment
There was a problem hiding this comment.
Looks good to me -- thank you @chunshao90
|
I'll clean up the clippy failures |
partition to table selection
|
Thanks again @chunshao90 ! |
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Support mysql partition selection, example:
Refer to https://dev.mysql.com/doc/refman/8.0/en/partitioning-selection.html