GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DuckDB: support * RENAME, unparenthesized star modifiers and a trailing comma by guizmaii · Pull Request #2801 · JSQLParser/JSqlParser

Conversation

@guizmaii

@guizmaii guizmaii commented Oct 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

For DuckDB's star expression modifiers (docs) and trailing commas in the select list (docs).

Input Before After
* RENAME (i AS x, j AS y), * RENAME i AS x error ColumnsTransformer of the new type RENAME
* EXCLUDE i, * EXCLUDE t.i error EXCLUDE with one column, printed without parentheses
* REPLACE i + 1 AS i error REPLACE with one item, printed without parentheses
SELECT a, b, FROM t, SELECT 1, LIMIT 1, (SELECT 1,) error the comma is dropped
  • ColumnsTransformer gains getRenameItems() and isParenthesized(). The unparenthesized forms are only recognised after * / t.*, as in DuckDB. REPLACE item needs an AS at its top level and RENAME needs column AS name for every column, so * rename / * replace stay aliases of the star and ClickHouse's REPLACE STRICT checks are unchanged.
  • Behaviour change: * REPLACE (a + 1) AS a is now DuckDB's single item (a + 1) AS a; it used to be an unaliased REPLACE(a + 1) with the star aliased a, which no dialect accepts.
  • The trailing comma is accepted before ), FROM, WHERE, HAVING, WINDOW, INTO, a set operator, GROUP BY/ORDER BY with an expression, and LIMIT/OFFSET followed by a number or ?. Columns and functions named after keywords keep parsing: SELECT a, limit FROM t, SELECT a, limit(1) FROM t, SELECT a, group by FROM t. A comma at the end of the input stays an error, and SELECT 1, LIMIT ALL is still a column. It applies wherever a select item list is parsed (RETURNING, PIVOT ... IN, DISTINCT ON, ...).
  • Apart from the REPLACE case above, all new inputs were errors in every dialect; on ~6,700 statements extracted from this repository's tests, results are identical to master.
  • checkGrammarAmbiguity: no conflicts. ./gradlew check: 10,118 tests, 0 failures.
  • DuckDB's own test suite (test/sql, 70,729 statements): 146 more parse, none less.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@guizmaii
guizmaii marked this pull request as ready for review October 13, 2026 09:19
Copilot AI balanced review requested due to automatic review settings October 13, 2026 09:19
Copilot AI reviewed Oct 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@guizmaii guizmaii mentioned this pull request Oct 13, 2026
DuckDB: remaining syntax to support #2804
Open
27 tasks
@guizmaii
guizmaii force-pushed the duckdb-star-modifiers branch 4 times, most recently from 12ff9c7 to a80100c Compare October 13, 2026 21:59
@manticore-projects

manticore-projects commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

sorry, conflicts from overlapping PRs. Please resolve.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

guizmaii added 3 commits October 14, 2026 09:22
@guizmaii
DuckDB: support * RENAME, unparenthesized star modifiers and a traili…
f3330d5
…ng comma

- `* RENAME (i AS x, j AS y)` and `* RENAME i AS x` are the new RENAME
  `ColumnsTransformer`.
- After `*`, `EXCLUDE i`, `REPLACE i + 1 AS i` and `RENAME i AS x` may
  name a single column or item without parentheses, and print back that
  way. Unparenthesized REPLACE and RENAME require the `AS name`.
- A select list may end with a comma before a clause such as FROM,
  WHERE or `ORDER BY`, or before `)`. Keywords that may name a column,
  as in `SELECT a, limit FROM t`, still do. The comma is not printed.
@guizmaii
Keep stars aliased rename or replace and functions named limit
6ec6e45
- Unparenthesized REPLACE needs an AS at the top level of its item, and
  RENAME needs `column AS name` for each item, so `* rename` and
  `* replace` stay aliases of the star.
- `REPLACE (a + 1) AS a` is a single item, as in DuckDB, not a list
  without an alias.
- A comma before `limit(` or `offset(` starts a select item again, and
  `group by` / `order by` right before FROM or the end are a column and
  its alias.
- A transformer with more than one item or column prints parentheses.
@guizmaii
Refer to AllColumns by its simple name in DuckDBTest
8353381
@guizmaii
guizmaii force-pushed the duckdb-star-modifiers branch from a80100c to 8353381 Compare October 13, 2026 22:25
@manticore-projects
manticore-projects merged commit f7d84c8 into JSQLParser:master Oct 13, 2026
4 of 5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects

manticore-projects commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guizmaii

guizmaii commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on master, conflicts resolved.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@guizmaii guizmaii mentioned this pull request Oct 13, 2026
DuckDB: support QUALIFY after WINDOW, OVER (w ...) and FILTER without WHERE #2803
Merged
@guizmaii
guizmaii deleted the duckdb-star-modifiers branch October 22, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@guizmaii @manticore-projects
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.