r1b commented on code in PR #2091:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2091#discussion_r2520148409
##########
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:
I took a stab at this in
https://github.com/apache/datafusion-sqlparser-rs/pull/2091/commits/3fc3094d05b8a3e46cdc37438ae62436a014ff61
--
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]