7phs commented on code in PR #1576:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1576#discussion_r1873845800
##########
tests/sqlparser_redshift.rs:
##########
@@ -353,3 +380,23 @@ fn test_parse_json_path_from() {
_ => panic!(),
}
}
+
+#[test]
+fn test_parse_select_numbered_columns() {
+ // An alias starting with a number
+ redshift_and_generic().verified_stmt(r#"SELECT 1 AS "1" FROM a"#);
+ redshift_and_generic().verified_stmt(r#"SELECT 1 AS "1abc" FROM a"#);
+}
+
+#[test]
+fn test_parse_nested_quoted_identifier() {
+ redshift().verified_stmt(r#"SELECT 1 AS ["1"] FROM a"#);
+ redshift().verified_stmt(r#"SELECT 1 AS [ " 1 " ]"#);
Review Comment:
It depends on what we want to achieve. I have implemented parsing of nested
quotations, guided by the test case
[brackets_over_db_schema_table_name_with_whites_paces](https://github.com/apache/datafusion-sqlparser-rs/blob/main/tests/sqlparser_redshift.rs#L69).
For example, the following query:
```
SELECT [ col1 ] FROM [ test_schema].[ test_table]
```
is successfully parsed using `verified_stmt`.
I don't have a strong opinion on this implementation and can adjust the
parsing if needed.
--
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]