Skip to content

Fix using wrong extreams in min-max index created on JSON column - #101918

Merged
Avogar merged 3 commits into
masterfrom
fix-json-in-min-max-index
Apr 17, 2026
Merged

Avogar merged 3 commits into
masterfrom
fix-json-in-min-max-index

Conversation

@Avogar

@Avogar Avogar commented Apr 7, 2026 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Critical Bug Fix (crash, data loss, RBAC)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix using wrong extreams in min-max index created on JSON column leading to wrong query result. Closes #101700.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.1025
  • Backported to: 26.3.10.20, 26.2.17.9, 26.1.12.7, 25.8.23.9

@clickhouse-gh

clickhouse-gh Bot commented Apr 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [105dbb9]

Summary: ✅


AI Review

Summary

This PR fixes ColumnObject::getExtremes to respect the requested row range instead of always using row 0, which is consistent with other column implementations and resolves incorrect minmax index bounds for JSON. The added stateless test reproduces and verifies the wrong-result case. Code change itself looks correct and targeted; I found no correctness/safety/performance regressions in the touched code.

PR Metadata

Changelog category is not semantically correct: this is a wrong-result fix, but not in the (crash, data loss, RBAC) bucket.

Suggested replacement category:
- Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry is required for this category and mostly good, but contains a typo (extreams) and can be made clearer.

Suggested replacement entry:
Fix wrong \\minmax\ index extremes for \\JSON\ columns, which could produce incorrect query results. Closes https://github.com/ClickHouse/ClickHouse/issues/101700.

Missing context
  • ⚠️ No CI logs/check results were provided in this review context.
Findings

💡 Nits

  • PR metadata typo/quality: extreams → extremes; and category should be Bug Fix rather than Critical Bug Fix (crash, data loss, RBAC).
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ⚠️ Changelog category mismatch and typo in Changelog entry (extreams).
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Fix PR metadata: set Changelog category to Bug Fix (user-visible misbehavior in an official stable release).
    • Fix Changelog entry wording/typo (extremes).

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Apr 7, 2026
@evillique evillique self-assigned this Apr 9, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member

The flaky check failure is fixed in #102148, let's update the branch.

@@ -0,0 +1,21 @@
-- Tags: no-parallel-replicas
-- Tag no-parallel-replicas: output of explain is different

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Typo in the test note: Tag should be Tags to match the standard header format (-- Tags: ...). Also consider uppercasing EXPLAIN for consistency with SQL keywords.

@clickhouse-gh

clickhouse-gh Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.10% 84.00% -0.10%
Functions 90.90% 90.90% +0.00%
Branches 76.60% 76.50% -0.10%

Changed lines: 57.14% (8/14) · Uncovered code

Full report · Diff report

@Avogar
Avogar added this pull request to the merge queue Apr 17, 2026
Merged via the queue into master with commit 2be6053 Apr 17, 2026
161 checks passed
@Avogar
Avogar deleted the fix-json-in-min-max-index branch April 17, 2026 13:19
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 17, 2026
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Apr 17, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Apr 17, 2026
Cherry pick #101918 to 26.2: Fix using wrong extreams in min-max index created on JSON column
robot-clickhouse added a commit that referenced this pull request Apr 17, 2026
robot-clickhouse-ci-2 added a commit that referenced this pull request Apr 17, 2026
Cherry pick #101918 to 26.3: Fix using wrong extreams in min-max index created on JSON column
robot-clickhouse added a commit that referenced this pull request Apr 17, 2026
clickhouse-gh Bot added a commit that referenced this pull request Apr 17, 2026
Backport #101918 to 26.2: Fix using wrong extreams in min-max index created on JSON column
Avogar added a commit that referenced this pull request Apr 20, 2026
Backport #101918 to 26.3: Fix using wrong extreams in min-max index created on JSON column
robot-clickhouse-ci-1 added a commit that referenced this pull request Apr 20, 2026
Cherry pick #101918 to 25.8: Fix using wrong extreams in min-max index created on JSON column
robot-clickhouse added a commit that referenced this pull request Apr 20, 2026
robot-clickhouse-ci-1 added a commit that referenced this pull request Apr 20, 2026
Cherry pick #101918 to 26.1: Fix using wrong extreams in min-max index created on JSON column
robot-clickhouse added a commit that referenced this pull request Apr 20, 2026
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Apr 20, 2026
clickhouse-gh Bot added a commit that referenced this pull request Apr 20, 2026
Backport #101918 to 26.1: Fix using wrong extreams in min-max index created on JSON column
Avogar added a commit that referenced this pull request Apr 23, 2026
Backport #101918 to 25.8: Fix using wrong extreams in min-max index created on JSON column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MinMax index on JSON column silently drops valid rows due to missing isObject() check in validator and broken getExtremes()

6 participants