iffyio commented on code in PR #2091:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2091#discussion_r2517652631


##########
src/parser/mod.rs:
##########
@@ -5521,16 +5521,19 @@ impl<'a> Parser<'a> {
         // peek the next token, which if it is another type keyword, then the
         // first token is a name and not a type in itself.
         let data_type_idx = self.get_current_index();
-        if let Some(next_data_type) = self.maybe_parse(|parser| 
parser.parse_data_type())? {
-            let token = self.token_at(data_type_idx);
+        // DEFAULT will be parsed as `DataType::Custom`, which is undesirable 
in this context
+        if !self.peek_keyword(Keyword::DEFAULT) {
+            if let Some(next_data_type) = self.maybe_parse(|parser| 
parser.parse_data_type())? {
+                let token = self.token_at(data_type_idx);
 
-            // We ensure that the token is a `Word` token, and not other 
special tokens.
-            if !matches!(token.token, Token::Word(_)) {
-                return self.expected("a name or type", token.clone());
-            }
+                // We ensure that the token is a `Word` token, and not other 
special tokens.
+                if !matches!(token.token, Token::Word(_)) {

Review Comment:
   Oh yeah indeed, I misread that block as happening inside of the maybe_parse. 
Yes the intent would be to ideally do the check in the maybe_parse I think



-- 
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]

Reply via email to