iffyio commented on code in PR #1602:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1602#discussion_r1884209745
##########
tests/sqlparser_bigquery.rs:
##########
@@ -2097,6 +2097,14 @@ fn test_bigquery_create_function() {
"REMOTE WITH CONNECTION us.myconnection ",
"OPTIONS(a = [1, 2])",
),
+ // Templated
+ concat!(
+ "CREATE OR REPLACE TEMPORARY FUNCTION ",
+ "my_function(param1 ANY TYPE) ",
+ "AS (",
+ "(SELECT 1)",
+ ")",
+ ),
Review Comment:
Since the functionality itself is the data type, I'm thinking we can use a
dedicated test for it? e.g `fn test_parse_any_type()`? Also can we add a test
case to demonstrate the behavior in the other comment what happens in a sql
like `CREATE TABLE foo (x ANY);`
##########
src/parser/mod.rs:
##########
@@ -8382,6 +8382,10 @@ impl<'a> Parser<'a> {
Ok(DataType::Tuple(field_defs))
}
Keyword::TRIGGER => Ok(DataType::Trigger),
+ Keyword::ANY => {
Review Comment:
```suggestion
Keyword::ANY if self.peek_keyword(Keyword::TYPE) => {
```
Thinking we can add this guard to ensure that it doesn't conflict with a
custom data type that happens to be called `ANY`?
--
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]