-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for BigQuery ANY TYPE
data type
#1602
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)", | ||
")", | ||
), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the functionality itself is the data type, I'm thinking we can use a dedicated test for it? e.g There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I was in fact doing that but reverted to inlining the test with other UDFs. Not being sure what was the preferred pattern but makes sense! |
||
]; | ||
for sql in sqls { | ||
bigquery().verified_stmt(sql); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking we can add this guard to ensure that it doesn't conflict with a custom data type that happens to be called
ANY
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes that is much more in line with the desired / intended behavior. As the current approach would result in a parsing error should we come across an ANY type I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried implementing this change but it seems to break. hmm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is the first time I'm touching the codebase, I needed to understand the general mechanisms. Your change worked in conjunction with
let _ = self.parse_keyword(Keyword::TYPE);
, which makes intitutive sense after looking at the code in general.