barsela1 opened a new pull request, #1645:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1645

   support trailing commas in FROM clause.
   
   - add a const global list of keyworads that are allowed to appear after 
FROM, called "ALLOWED_KEYWORD_AFTER_FROM"
   - Every dialict implement:
   --get_reserved_keyword_after_from function that returns 
ALLOWED_KEYWORD_AFTER_FROM as default. each dialect can customize the list if 
needed.
   -- supports_from_trailing_commas function that returns false  as default but 
for each dialect that supports trailing commas in the  FROM clause can 
customize the return value to true (e.g., Snowflake).
   - add a function "parse_from" to handle the FROM keyword. parse_from set and 
pass trailing_commas according to the return value of 
self.dialect.supports_from_trailing_commas().
   - change signature of parse_comma_separated_with_trailing_commas and 
is_parse_comma_separated_end_with_trailing_commas by adding parameter 
"reserved_keywords" (&[Keyword]) 
   -at  is_parse_comma_separated_end_with_trailing_commas: 
keywords::RESERVED_FOR_COLUMN_ALIAS.contains(&kw.keyword) replaced by 
reserved_keywords so that the reserved_keywords can be determined by the 
current parsing state.
   - In other cases where is_parse_comma_separated_end_with_trailing_commas is 
used, keywords::RESERVED_FOR_COLUMN_ALIAS can be obtained by calling the 
default_reserved_keywords function and passing it through the reserved_keywords 
parameter.
   
   tests:
   -added new tests.
   -all tests passed.
   


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