alexander-beedie opened a new pull request, #2156:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2156
Fixes a bug in Pipe SQL parsing with identifiers followed by the `|>`
operator; `parse_identifiers` needed to break on
`Token::VerticalBarRightAngleBracket` as well, otherwise it continues to
consume the following tokens as `Ident`.
## Example
```sql
FROM t |> DROP c |> RENAME a AS x
```
Without the fix, the query after the "FROM" section gets incorrectly parsed
as:
```rust
Drop { columns: [
Ident { value: "c", ... },
Ident { value: "RENAME", ... },
Ident { value: "a", ... },
Ident { value: "AS", ... },
Ident { value: "x", ... }]
}
```
After the fix the `|>`-separated sections are parsed correctly:
```
Drop { columns: [Ident { value: "c" }] }
Rename { mappings: [
IdentWithAlias { ident: Ident { value: "a" }, alias: Ident { value: "x"
} }]
}
```
## Also
Updated the pipe operator tests with some new coverage for the above, and a
helper that additionally validates queries that start "FROM tbl" with the pipe
operator (which was missing).
--
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]