Bring back the "|" symbol and eliminate search rakes #5436
Merged
+4,500
−4,395
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit brings back the "|" symbol for pipeline separator while retaining the "|>" as an option. The latter is needed to exit a SQL expression back into a pipe when a SQL expression is immediately followed by a shortcut that begins with an identifier (implied-yield expression or agg function).
For any valid query without shortcuts, there is never an ambiguity between the bitwise OR "|" and pipe separator because keywords cannot be used as identifiers. The argument that such ambiguity is present made in the Google SQL pipes paper presumably assumes a one-token lookahead parser, which is not the case here.
Toward this end, we changed our grammar to disallow keywords as identifier and added the backtick-string syntax to escape any string as identifier.
We also removed search syntax as a shortcut and now require a "?" (or "search" keyword) to signal the keyword search operator. This means typos that happen to compile into unintended searches are no longer accepted by the grammar thereby eliminating the so-called search rake.