iffyio commented on code in PR #1686:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1686#discussion_r1934222955
##########
src/dialect/mod.rs:
##########
@@ -340,12 +340,21 @@ pub trait Dialect: Debug + Any {
/// Returns true if the dialect supports lambda functions, for example:
///
/// ```sql
- /// SELECT transform(array(1, 2, 3), x -> x + 1); -- returns [2,3,4]
+ /// SELECT transform(array(1, 2, 3), (x) -> x + 1); -- returns [2,3,4]
/// ```
fn supports_lambda_functions(&self) -> bool {
false
}
+ /// Returns true if the dialect supports lambda functions without
parentheses for a single argument, for example:
+ ///
+ /// ```sql
+ /// SELECT transform(array(1, 2, 3), x -> x + 1); -- returns [2,3,4]
+ /// ```
+ fn supports_parensless_lambda_functions(&self) -> bool {
Review Comment:
If I understand correctly the idea with introducing this method is to avoid
the Generic dialect's syntax conflict due to its pg json syntax support? If so
I'm thinking it could more sense to turn off `supports_lambda_functions` for
the Generic dialect instead, idea with the dialect is that it gets feature
support by default only if there aren't conflicting syntax. So that if its not
expected that a dialect supports `(x) -> y` but not `x -> y` then maybe Generic
dialect shouldn't support lambdas after all
--
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]