7phs commented on code in PR #1576:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1576#discussion_r1873380547


##########
tests/sqlparser_redshift.rs:
##########
@@ -353,3 +378,20 @@ fn test_parse_json_path_from() {
         _ => panic!(),
     }
 }
+
+#[test]
+fn test_parse_select_numbered_columns() {
+    redshift_and_generic().verified_stmt(r#"SELECT 1 AS "1" FROM a"#);
+    // RedShift specific case - quoted identifier inside square bracket
+    redshift().verified_stmt(r#"SELECT 1 AS ["1"] FROM a"#);
+    redshift().verified_stmt(r#"SELECT 1 AS ["[="] FROM a"#);
+    redshift().verified_stmt(r#"SELECT 1 AS ["=]"] FROM a"#);
+    redshift().verified_stmt(r#"SELECT 1 AS ["a[b]"] FROM a"#);
+}
+
+#[test]
+fn test_parse_create_numbered_columns() {
+    redshift_and_generic().verified_stmt(
+        r#"CREATE TABLE test_table_1 ("1" INT, "d" VARCHAR(155), "2" DOUBLE 
PRECISION)"#,
+    );
+}

Review Comment:
   I moved this special case (numbered named alias) into the 
`parse_delimited_identifiers` test.



##########
tests/sqlparser_redshift.rs:
##########
@@ -353,3 +378,20 @@ fn test_parse_json_path_from() {
         _ => panic!(),
     }
 }
+
+#[test]
+fn test_parse_select_numbered_columns() {

Review Comment:
   I split the test into two to make it more explicit:
   1. `test_parse_select_numbered_columns` - it is a reason for this MR
   2. `test_parse_nested_quoted_identifier`
   
   I added suggested cases into `test_parse_nested_quoted_identifier`



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