You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2022/12/14 16:29:19 UTC

[arrow-datafusion] branch master updated: remove consume_token (#4609)

This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 81e1d6339 remove consume_token (#4609)
81e1d6339 is described below

commit 81e1d633973960b4bac0c854d1a62f83975cfc94
Author: Remzi Yang <59...@users.noreply.github.com>
AuthorDate: Thu Dec 15 00:29:14 2022 +0800

    remove consume_token (#4609)
    
    Signed-off-by: remzi <13...@gmail.com>
    
    Signed-off-by: remzi <13...@gmail.com>
---
 datafusion/sql/src/parser.rs | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/datafusion/sql/src/parser.rs b/datafusion/sql/src/parser.rs
index 57a4299eb..d4af9f869 100644
--- a/datafusion/sql/src/parser.rs
+++ b/datafusion/sql/src/parser.rs
@@ -391,7 +391,7 @@ impl<'a> DFParser<'a> {
     }
 
     fn parse_has_options(&mut self) -> bool {
-        self.consume_token(&Token::make_keyword("OPTIONS"))
+        self.parser.parse_keyword(Keyword::OPTIONS)
     }
 
     //
@@ -417,17 +417,6 @@ impl<'a> DFParser<'a> {
         Ok(options)
     }
 
-    fn consume_token(&mut self, expected: &Token) -> bool {
-        let token = self.parser.peek_token().to_string().to_uppercase();
-        let token = Token::make_keyword(&token);
-        if token == *expected {
-            self.parser.next_token();
-            true
-        } else {
-            false
-        }
-    }
-
     fn parse_has_file_compression_type(&mut self) -> bool {
         self.parser
             .parse_keywords(&[Keyword::COMPRESSION, Keyword::TYPE])
@@ -439,7 +428,7 @@ impl<'a> DFParser<'a> {
     }
 
     fn parse_has_delimiter(&mut self) -> bool {
-        self.consume_token(&Token::make_keyword("DELIMITER"))
+        self.parser.parse_keyword(Keyword::DELIMITER)
     }
 
     fn parse_delimiter(&mut self) -> Result<char, ParserError> {