yoabot-droid opened a new pull request, #2229:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2229
## Problem
Redshift supports aliasing wildcard expressions in SELECT statements:
```sql
SELECT t.* AS alias FROM t
```
Previously the parser would fail with:
```
ParserError("Expected: end of statement, found: AS")
```
This was confirmed working on a live Redshift database.
## Solution
- Added `opt_alias: Option<Ident>` field to `WildcardAdditionalOptions`
- Added `supports_select_wildcard_with_alias()` method to the `Dialect`
trait (default: `false`)
- Enabled the method in `RedshiftSqlDialect`
- In `parse_wildcard_additional_options`, parse an optional `AS <alias>`
when the dialect supports it
- Updated `Display` and span tracking for the new field
## Tests
Added regression tests in `tests/sqlparser_redshift.rs`:
- Qualified wildcard with alias: `SELECT t.* AS all_cols FROM t`
- Unqualified wildcard with alias: `SELECT * AS all_cols FROM t`
- Mixed multi-join query with regular column + qualified wildcard alias
--
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]