alamb commented on code in PR #2540:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2540#discussion_r4073854275
##########
src/parser/mod.rs:
##########
@@ -15625,44 +15625,16 @@ impl<'a> Parser<'a> {
/// Parse `CREATE TABLE x AS TABLE y`
pub fn parse_as_table(&mut self) -> Result<Table, ParserError> {
- let token1 = self.next_token();
- let token2 = self.next_token();
- let token3 = self.next_token();
-
- let table_name;
- let schema_name;
- if token2 == Token::Period {
- match token1.token {
- Token::Word(w) => {
- schema_name = w.value;
- }
- _ => {
- return self.expected("Schema name", token1);
- }
- }
- match token3.token {
- Token::Word(w) => {
- table_name = w.value;
- }
- _ => {
- return self.expected("Table name", token3);
- }
- }
+ let first_name = self.parse_identifier()?;
+ if self.consume_token(&Token::Period) {
+ let second_name = self.parse_identifier()?;
Review Comment:
fixing bugs and deleting code is level 10 coding 👍
--
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]