iffyio commented on code in PR #1663:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1663#discussion_r1921003867
##########
src/parser/mod.rs:
##########
@@ -9342,12 +9342,37 @@ impl<'a> Parser<'a> {
optional: IsOptional,
allow_empty: bool,
) -> Result<Vec<Ident>, ParserError> {
+ self.parse_parenthesized_column_list_inner(optional, allow_empty, |p|
p.parse_identifier())
+ }
+
+ /// Parses a parenthesized comma-separated list of unqualified, possibly
quoted identifiers
Review Comment:
The doc comment doesn't seem to match the behavior (unqualified vs
qualified)? also it could be nice if the doc highlights that the parenthesis is
also expected in the input (maybe with an example)
##########
src/parser/mod.rs:
##########
@@ -9342,12 +9342,37 @@ impl<'a> Parser<'a> {
optional: IsOptional,
allow_empty: bool,
) -> Result<Vec<Ident>, ParserError> {
+ self.parse_parenthesized_column_list_inner(optional, allow_empty, |p|
p.parse_identifier())
+ }
+
+ /// Parses a parenthesized comma-separated list of unqualified, possibly
quoted identifiers
+ pub fn parse_parenthesized_qualified_column_list(
+ &mut self,
+ optional: IsOptional,
+ allow_empty: bool,
+ ) -> Result<Vec<ObjectName>, ParserError> {
+ self.parse_parenthesized_column_list_inner(optional, allow_empty, |p| {
+ p.parse_object_name(false)
Review Comment:
Should the `in_table_clause` be configurable here? I thinking it's supposed
to be set to true when parsing a `USING` clause given the behavior being fixed
##########
tests/sqlparser_snowflake.rs:
##########
@@ -2650,6 +2650,9 @@ fn asof_joins() {
"ON s.state = p.state ",
"ORDER BY s.observed",
));
+
+ // Snowflake allows fully-qualified column names inside USING
+ snowflake().verified_stmt("SELECT * FROM tbl1 AS t1 JOIN tbl2 AS t2
USING(t2.col1)");
Review Comment:
maybe we can add this scenario to the `parse_joins_using` test in common.rs
instead?
--
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]