-
Notifications
You must be signed in to change notification settings - Fork 691
Fixed select dollar column from stage for snowflake #2165
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
base: main
Are you sure you want to change the base?
Conversation
| let args = if self.consume_token(&Token::LParen) { | ||
| Some(self.parse_table_function_args()?) | ||
| } else { | ||
| None |
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.
can we add a test case that doesn't include table function args?
| None | ||
| }; | ||
|
|
||
| let alias = self.maybe_parse_table_alias()?; |
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.
can we add a test case that doesn't include an alias?
| } | ||
|
|
||
| /// Parse a Snowflake stage reference as a table factor. | ||
| /// Handles syntax like: `@mystage1 (file_format => 'myformat', pattern => '...')` |
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.
Can we link to the documentation that supports this syntax?
| && self.peek_keyword_with_tokens(Keyword::SEMANTIC_VIEW, &[Token::LParen]) | ||
| { | ||
| self.parse_semantic_view_table_factor() | ||
| } else if dialect_of!(self is SnowflakeDialect) |
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.
If we need a guard for this I think we would instead use a method on the dialect trait (we're moving away from the dialect_of macro for new code). But I think the guard shouldn't be needed in the first place? so that if we see a SELECT * FROM @foo T we can always accept it regardless of dialect?
Fixed this query for snowflake:
Documentation:
https://docs.snowflake.com/en/user-guide/querying-stage#example-1-querying-columns-in-a-csv-file
Specifically
t.$1part didn't work before