Skip to content

Conversation

@murphyatwork
Copy link
Contributor

@murphyatwork murphyatwork commented Dec 11, 2025

Why I'm doing:

What I'm doing:

Minimal length is 1024, which should be allowed.

Fixes #https://github.com/StarRocks/StarRocksTest/issues/10673

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 4.0
    • 3.5
    • 3.4
    • 3.3

Note

Permits schema change from JSON to CHAR/VARCHAR when target length equals the JSON minimum (e.g., 1024).

  • Catalog
    • In Column.checkSchemaChangeAllowed, relax JSON length check: change <= to < so converting JSON to CHAR/VARCHAR is allowed when target strLen equals PrimitiveType.JSON.getTypeSize().

Written by Cursor Bugbot for commit b81f3cd. This will update automatically on new commits. Configure here.

Signed-off-by: Murphy <mofei@starrocks.com>
@murphyatwork murphyatwork requested a review from a team as a code owner December 11, 2025 07:57
Copilot AI review requested due to automatic review settings December 11, 2025 07:57
@mergify
Copy link
Contributor

mergify bot commented Dec 11, 2025

🧪 CI Insights

Here's what we observed from your CI run for b81f3cd.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

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 pull request fixes an off-by-one error in JSON to VARCHAR schema change validation. The issue was that when converting a JSON column to VARCHAR, the code incorrectly rejected VARCHAR with exactly the minimum required length of 1024 bytes.

Key Change:

  • Fixed the comparison operator in Column.checkSchemaChangeAllowed() from <= to < to allow VARCHAR(1024) when converting from JSON type, which has a minimum type size of 1024 bytes.

@sonarqubecloud
Copy link

@alvin-celerdata
Copy link
Contributor

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@github-actions
Copy link

[Java-Extensions Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[BE Incremental Coverage Report]

pass : 0 / 0 (0%)

@github-actions
Copy link

[FE Incremental Coverage Report]

pass : 1 / 1 (100.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 com/starrocks/catalog/Column.java 1 1 100.00% []

@murphyatwork murphyatwork enabled auto-merge (squash) December 12, 2025 05:51
@murphyatwork murphyatwork merged commit ed8b59b into StarRocks:main Dec 15, 2025
130 of 140 checks passed
@github-actions
Copy link

@Mergifyio backport branch-3.5

@github-actions github-actions bot removed the 3.5 label Dec 15, 2025
@github-actions
Copy link

@Mergifyio backport branch-4.0

@github-actions github-actions bot removed the 4.0 label Dec 15, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2025

backport branch-3.5

✅ Backports have been created

Details

@mergify
Copy link
Contributor

mergify bot commented Dec 15, 2025

backport branch-4.0

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Dec 15, 2025
mergify bot pushed a commit that referenced this pull request Dec 15, 2025
murphyatwork added a commit that referenced this pull request Dec 15, 2025
wanpengfei-git pushed a commit that referenced this pull request Dec 15, 2025
Co-authored-by: Murphy <96611012+murphyatwork@users.noreply.github.com>
murphyatwork added a commit that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants