You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "yoavcloud (via GitHub)" <gi...@apache.org> on 2024/11/19 21:35:24 UTC

[PR] Add support for data type specific methods [datafusion-sqlparser-rs]

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

   This PR adds support for static method invocations of data type-specific methods. For example: 
   `SELECT geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656 )', 4326)`
   
   See more here: https://learn.microsoft.com/en-us/sql/t-sql/spatial-geography/spatial-types-geography?view=sql-server-ver16


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add support for data type specific methods [datafusion-sqlparser-rs]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1535:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1535#issuecomment-2608684754

   Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add support for data type specific methods [datafusion-sqlparser-rs]

Posted by "iffyio (via GitHub)" <gi...@apache.org>.
iffyio commented on code in PR #1535:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1535#discussion_r1855132514


##########
src/parser/mod.rs:
##########
@@ -1224,6 +1224,17 @@ impl<'a> Parser<'a> {
                             body: Box::new(self.parse_expr()?),
                         }));
                     }
+                    Token::DoubleColon if self.dialect.supports_methods() => {
+                        let namespace = w.value;
+                        self.expect_token(&Token::DoubleColon)?;
+                        let name_with_namespace = match self.next_token().token {
+                            Token::Word(func_name) => {
+                                ObjectName(vec![Ident::new(format!("{}::{}", namespace, func_name.value))])
+                            },
+                            _ => return self.expected("identifier", self.peek_token())
+                        };
+                        Ok(self.parse_function(name_with_namespace)?)

Review Comment:
   Can we move the body to a `self.parse_namespaced_method(w)?` or similar function? Also if we can add an example syntax to the function doc with the link to clarify the syntax



##########
tests/sqlparser_common.rs:
##########
@@ -11550,6 +11550,14 @@ fn parse_method_expr() {
         }
         _ => unreachable!(),
     }
+
+    dialects.verified_stmt(

Review Comment:
   Can we add a scenario in the style of `a::b::c().d()`?



-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [PR] Add support for data type specific methods [datafusion-sqlparser-rs]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #1535: Add support for data type specific methods
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1535


-- 
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-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org