Skip to content

[PIVOT] Optional AS keyword for aliases - #2209

Merged
iffyio merged 3 commits into
apache:mainfrom
xitep:main
Feb 18, 2026
Merged

[PIVOT] Optional AS keyword for aliases#2209
iffyio merged 3 commits into
apache:mainfrom
xitep:main

Conversation

@xitep

@xitep xitep commented Feb 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@xitep xitep changed the title [PIVOT/UNPIVOT] Optional AS keyword for value aliases [PIVOT] Optional AS keyword for aliases Feb 8, 2026
@xitep xitep closed this Feb 11, 2026
@xitep xitep reopened this Feb 11, 2026

@iffyio iffyio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @xitep!

@iffyio
iffyio added this pull request to the merge queue Feb 18, 2026
Merged via the queue into apache:main with commit 63eeaa0 Feb 18, 2026
10 checks passed
sabir-akhadov-localstack added a commit to localstack/datafusion-sqlparser-rs that referenced this pull request Aug 22, 2026
…oving the privilege (account + database role) (apache#2209)

* Task LAV-1748: REVOKE GRANT OPTION FOR — flip grant_option without removing privilege

Add end-to-end support for REVOKE GRANT OPTION FOR <privileges> ON <object>
FROM {ROLE <name> | DATABASE ROLE <db>.<name>}. The statement flips
grant_option to false on matching live grant edges, keeping the privilege
edge itself intact. The status string reports the count of edges actually
flipped: 'Statement executed successfully. N objects affected.'

Parser: add grant_option_for field to Revoke struct; parse the GRANT OPTION
FOR prefix in parse_revoke.

Transform: route grant_option_for revokes to a new __snowflake
UDF instead of the soft-deleting __snowflake.

Extension: the new UDF validates role existence (002003/02000 for missing
roles), flips grant_option to false + refreshes created_at on matching live
edges, counts flipped rows via GET DIAGNOSTICS, and returns the N-objects
status. ALL PRIVILEGES expands to match-all (null privilege), flipping every
matching edge.

Compat tests cover the true→false flip with privilege retained, the
repeat-revoke 0-objects case, the never-granted 0-objects case, the ALL
PRIVILEGES multi-edge case, the FROM DATABASE ROLE variant, and the
missing-role error path. Snapshots captured against real Snowflake.

Co-Authored-By: Claude <noreply@anthropic.com>

* task LAV-1748: fix CI — add grant_option_for to Revoke destructuring in vendored sqlparser tests

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants