Add STATISTICS support for column declarations and ALTER TABLE commands#105
Merged
Conversation
- Add Statistics field to ColumnDeclaration AST node for column-level STATISTICS(type) syntax in CREATE TABLE - Add parseStatisticsExpr to parse STATISTICS(...) after data type - Add ALTER TABLE STATISTICS command types: ADD_STATISTICS, MODIFY_STATISTICS, DROP_STATISTICS, CLEAR_STATISTICS, MATERIALIZE_STATISTICS - Add StatisticsColumns and StatisticsTypes fields to AlterCommand - Add parseStatisticsColumnList and parseStatisticsTypeList helpers - Add explain output for STATISTICS in column declarations and ALTER commands - Update test metadata: reduced 02864_statistics_ddl from 65 to 5 pending The remaining 5 statements (stmt104, stmt105, stmt111, stmt112, stmt135) appear to have mismatched test data where expected files expect DROP_STATISTICS but the SQL contains CLEAR STATISTICS.
ClickHouse optimizes CLEAR STATISTICS to DROP_STATISTICS in EXPLAIN AST output. Apply the same normalization to match expected output. This completes the 02864_statistics_ddl test - all 65 statements now pass.
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.
STATISTICS(type) syntax in CREATE TABLE
DROP_STATISTICS, CLEAR_STATISTICS, MATERIALIZE_STATISTICS
The remaining 5 statements (stmt104, stmt105, stmt111, stmt112, stmt135) appear
to have mismatched test data where expected files expect DROP_STATISTICS but
the SQL contains CLEAR STATISTICS.