Skip to content

Conversation

@dantengsky
Copy link
Member

@dantengsky dantengsky commented Feb 6, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • Enable Parquet no-rewrite widening for RangeIndex-supported types: lossless numeric widen, decimal precision widen with the same scale, and existing STRING -> BINARY. Scale changes still require rewrite.
  • Keep pruning effective across old blocks: range/page stats are cast to the target type with safe fallback; bloom pruning reuses block stats types to compute digests (cast failure skips that block).
  • Merge/recluster now tolerates mixed stats types by casting and dropping incompatible min/max with warnings to avoid wrong segment/table stats.

Example (no rewrite):

CREATE TABLE t(c Int32, d Decimal(10,2)) ENGINE=FUSE;
INSERT INTO t VALUES (1, 1.23);

ALTER TABLE t MODIFY COLUMN c Int64;
ALTER TABLE t MODIFY COLUMN d Decimal(20,2);

-- old blocks remain, pruning still works.
SELECT * FROM t WHERE c = 1;

Example (scale change requires rewrite):

CREATE TABLE t2(d Decimal(10,2)) ENGINE=FUSE;
INSERT INTO t2 VALUES (1.23);

ALTER TABLE t2 MODIFY COLUMN d Decimal(10,3);

Reason: changing scale changes the numeric representation (value is rescaled), so existing Parquet values and stats no longer match the new scale. To keep correctness and pruning, data must be rewritten.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Feb 6, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3f6daa768

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dantengsky dantengsky marked this pull request as draft February 6, 2026 13:21
@dantengsky dantengsky changed the title fix(storage): allow parquet widening without rewrite feat(storage): allow parquet widening without rewrite Feb 6, 2026
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Feb 6, 2026
@dantengsky dantengsky force-pushed the feat/optimize-schema-evolution branch from dc9590d to 71770e6 Compare February 6, 2026 16:05
@dantengsky dantengsky changed the title feat(storage): allow parquet widening without rewrite feat(storage): allow column type widening without rewrite Feb 7, 2026
@dantengsky dantengsky removed the pr-bugfix this PR patches a bug in codebase label Feb 8, 2026
@dantengsky
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 07e721e39e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dantengsky
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2ed35c29f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dantengsky
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 859ec77c7b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dantengsky
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fce9804a10

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@dantengsky
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant