-
Notifications
You must be signed in to change notification settings - Fork 567
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
BigQuery: Add support for select expr star #1680
Conversation
9517f5d
to
c666d8d
Compare
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.
Thanks @iffyio -- this looks good to me. What mind blowing syntax
/// Expression is an object name. | ||
/// e.g. `alias.*` or even `schema.table.*` | ||
ObjectName(ObjectName), | ||
/// Select star on an arbitrary expression. |
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.
👍
// Identifier wildcard expansion. | ||
let select = dialects.verified_only_select("SELECT foo.bar.* FROM T"); | ||
let SelectItem::QualifiedWildcard(SelectItemQualifiedWildcardKind::ObjectName(object_name), _) = | ||
only(&select.projection) |
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.
only
is a neat trick
); | ||
|
||
// Arbitrary compound expression with wildcard expansion. | ||
let select = dialects.verified_only_select("SELECT foo - bar.* FROM T"); |
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.
this is kind of wild
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.
😅 thankfully the query isn't semantically valid, maybe the test is misleading in that sense, I added it only to verify that the parser accepts arbitrary expressions and wildcard on variables, but as far as binary operators specifically combined with the wildcard syntax wouldn't have meaning in BigQuery either
Adds support for wildcard expression on arbitrary expressions in select lists. Example: ```sql SELECT l.LOCATION[offset(0)].* FROM l ``` https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select_expression_star
c666d8d
to
c0f00fd
Compare
This reverts commit 73dbd91.
Adds support for wildcard expression on arbitrary
expressions in select lists.
Example:
https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#select_expression_star