Repository navigation
Unify column option storage and mutation contracts - #2769
Merged
manticore-projects merged 1 commit intoOct 11, 2026
Merged
manticore-projects merged 1 commit into
manticore-projects merged 1 commit into
Conversation
Signed-off-by: minleejae <mmj9808@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Give callers one predictable way to inspect and edit CREATE/ALTER column options. Today
getColumnSpecs().add(...)changes SQL for raw specifications but silently edits a detached copy when structured options are present.Current design (As-is)
ColumnDefinitionhas mutually exclusivecolumnSpecsandcolumnOptionslists. The grammar collects both token and node representations, then discards the nodes for raw-only definitions. List ownership and getter mutation behavior depend on which representation is active.Target design (To-be)
List<ColumnOption>, retaining opaque specifications asKind.OTHERnodes. Remove the duplicate field and grammar token collection.getColumnSpecs()in every mode. UseaddColumnSpecs(...)to append,setColumnSpecs(...)to explicitly replace all options with raw text, or edit the mutable nodes/list returned bygetColumnOptions().API migration: mutating
getColumnSpecs()now throwsUnsupportedOperationException. Raw-only options are also visible throughgetColumnOptions(); ALTER definitions without options expose an empty option list. Consumers should inspect node kinds instead of using list nullness to detect structured options. SQL acceptance and rendering are unchanged.Validation
Java 17 Gradle
spotlessApply check: 9,962 tests, 9,937 passed, 25 skipped, zero failures/errors. Grammar, formatting, Checkstyle, PMD, SpotBugs and coverage checks pass.11 new regression cases cover raw/typed CREATE and ALTER definitions, snapshots, input ownership, live child edits, visitor/deparser behavior, replacement, null/empty values, fluent builders and subclass construction. The constructor regression fails against the version that called an overridable setter.
Additional cached PMD checks with default NPath/cyclomatic-complexity and field-placement thresholds: zero violations before and after in the changed production class.
A local integration of all eight follow-ups (Use one foreign-key state in ALTER TABLE #2764–Separate ALTER key definitions from column drop targets #2771), with overlapping ALTER edits resolved, passes the complete Java 17 Gradle
check: 10,079 tests, 10,054 passed, 25 skipped, zero failures/errors.Replayed 882 previously DB-validated DDL fixtures against that integrated build: 875 pass with unchanged SQL output and reparsing; the same seven existing parse gaps remain. Nine statements intentionally expose raw
ColumnOptionnodes in the AST node-type set. No other result differences except generated grammar source locations; no fresh database execution.This is an independent follow-up to #2747, based on
master(cdbaf1ad).