You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "strongduanmu (via GitHub)" <gi...@apache.org> on 2026/07/29 10:48:35 UTC
Re: [PR] Support function table alias column parsing for PostgreSQL and openGauss [shardingsphere]
strongduanmu commented on PR #39268:
URL: https://github.com/apache/shardingsphere/pull/39268#issuecomment-5116722692
**Review Result: Mergeable**
This PR is mergeable from a code-correctness perspective. The change correctly preserves PostgreSQL and openGauss function table aliases and alias column lists for `FROM` table functions such as `generate_series(...) AS s(r)`, and the
parsed alias columns are available to the existing function-table binder path.
### Evidence
- Reviewed PR head: `6742c590caf738152852680f913e02a9562001ac`.
- Base reference checked: `master` at `381cf7d446c1df42e441a716613b7ce58c681764`; local merge-base was `79251e0abdf084766eaaba18deddfaa5f20d3577`.
- Authoritative scope: GitHub reported 9 changed files, and the local triple-dot file list matched all 9 files.
- PostgreSQL path: `PostgreSQLStatementVisitor#getFunctionTableSegment` now sets the function table alias from `funcAliasClause.aliasClause()` and copies `aliasClause.nameList()` into `FunctionTableSegment#getColumns()`.
- openGauss path: `OpenGaussStatementVisitor#getFunctionTableSegment` now keeps the table alias as only `s` while separately preserving alias columns such as `r`, avoiding the previous alias value pollution from `s(r)`.
- Binder path: `TableSegmentBinder` already builds a `FunctionTableSegmentBinderContext` from `FunctionTableSegment#getColumns()`, so the newly parsed alias columns are consumed by the existing binding model.
- Test path: the new visitor tests cover direct AST construction for both PostgreSQL and openGauss, and the parser IT case covers `SELECT s.r FROM generate_series(1, 3) AS s(r)` for both dialects.
- Official syntax support: PostgreSQL and openGauss SELECT documentation both allow function calls in `FROM` with table aliases and column alias lists.
### Coverage
- Reviewed behavior clusters:
- PostgreSQL function table alias and alias-column parsing.
- openGauss function table alias and alias-column parsing.
- Function table alias-column assertion support in parser IT.
- New PostgreSQL/openGauss parser IT case for `generate_series(...) AS s(r)`.
- Release note entry for the parser enhancement.
- Checked related contracts:
- PostgreSQL/openGauss grammar `funcAliasClause` and `aliasClause`.
- `FunctionTableSegment` alias and columns model.
- `TableSegmentBinder` and `FunctionTableSegmentBinderContext` consumption path.
- Parser IT `TableAssert` and `ExpectedFunctionTable` JAXB model.
- Public PR context:
- PR comments: none.
- PR reviews: none.
- PR body references `Fixes #39255`; that target is a closed PR and does not add a separate issue requirement for this review.
- CI scope: Code Correctness Review only. GitHub Actions were not queried, and the user stated local E2E already passed.
- Remaining risks: no code-correctness blocker found within the reviewed scope.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org