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


##########
src/dialect/mod.rs:
##########
@@ -835,6 +835,11 @@ pub trait Dialect: Debug + Any {
         false
     }
 
+    /// Returns true if this dialect allows an optional `SIGNED` suffix after 
integer data types.
+    fn allow_optional_signed_suffix(&self) -> bool {

Review Comment:
   ```suggestion
       fn supports_data_type_signed_suffix(&self) -> bool {
   ```



##########
src/parser/mod.rs:
##########
@@ -9852,6 +9852,8 @@ impl<'a> Parser<'a> {
                     if self.parse_keyword(Keyword::UNSIGNED) {
                         Ok(DataType::TinyIntUnsigned(optional_precision?))
                     } else {
+                        let _ = dialect.allow_optional_signed_suffix()
+                            && self.parse_keyword(Keyword::SIGNED);

Review Comment:
   ```suggestion
                           if dialect.allow_optional_signed_suffix() {
                               let _ = self.parse_keyword(Keyword::SIGNED);
                           }
   ```
   Thinking we can be explicit with an if statement for these?



##########
tests/sqlparser_mysql.rs:
##########
@@ -1705,6 +1705,51 @@ fn parse_create_table_unsigned() {
     }
 }
 
+#[test]
+fn parse_create_table_signed() {

Review Comment:
   ```suggestion
   fn parse_signed_data_types() {
   ```



##########
src/dialect/mod.rs:
##########
@@ -835,6 +835,11 @@ pub trait Dialect: Debug + Any {
         false
     }
 
+    /// Returns true if this dialect allows an optional `SIGNED` suffix after 
integer data types.

Review Comment:
   ```suggestion
       /// Returns true if this dialect allows an optional `SIGNED` suffix 
after integer data types.
       /// Example: `CREATE TABLE foo (bar INT(20) SIGNED)`
   ```
   Thinking maybe with an example to clarify the syntax



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to