Skip to content

Conversation

@git-hulk
Copy link
Member

This closes #204.

@git-hulk git-hulk requested a review from Copilot October 28, 2025 02:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the optional IN PARTITION expression in ALTER TABLE UPDATE statements, allowing users to specify which partition to update. The change implements the full syntax: ALTER TABLE UPDATE column = expr [IN PARTITION partition_id] WHERE condition.

Key changes:

  • Added InPartition field to AlterTableUpdate AST node
  • Modified parser to handle IN PARTITION clause between assignments and WHERE clause
  • Updated tree walking and visitor patterns to traverse the new field

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
parser/ast.go Added InPartition field to AlterTableUpdate struct and updated String() and Accept() methods
parser/parser_alter.go Modified parser to handle IN PARTITION clause and updated comment documenting the syntax
parser/walk.go Added Walk traversal for the new InPartition field
parser/testdata/ddl/alter_table_update_in_partition.sql Added test case with IN PARTITION clause
parser/testdata/ddl/format/alter_table_update_in_partition.sql Added formatting test for new syntax
parser/testdata/ddl/output/alter_table_update_in_partition.sql.golden.json Added golden output showing parsed AST structure
parser/testdata/ddl/output/alter_table_update.sql.golden.json Updated to include null InPartition field
parser/testdata/ddl/output/alter_table_update_with_cluster.sql.golden.json Updated to include null InPartition field

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@git-hulk git-hulk requested a review from Lance726 October 28, 2025 02:14
@coveralls
Copy link

Pull Request Test Coverage Report for Build 18861853338

Details

  • 11 of 19 (57.89%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.007%) to 50.241%

Changes Missing Coverage Covered Lines Changed/Added Lines %
parser/parser_alter.go 6 8 75.0%
parser/walk.go 1 3 33.33%
parser/ast.go 4 8 50.0%
Totals Coverage Status
Change from base Build 18827715548: 0.007%
Covered Lines: 7509
Relevant Lines: 14946

💛 - Coveralls

@Lance726 Lance726 merged commit 5c0f9cc into AfterShip:master Oct 28, 2025
2 checks passed
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.

Add support of IN PARTITION expression for ALTER TABLE ... UPDATE

3 participants