Skip to content

MergeTreeData: force Wide part format when the table has deprecated Object columns#1416

Open
mkmkme wants to merge 3 commits intoreleases/25.8.16from
mkmkme/object-fix
Open

MergeTreeData: force Wide part format when the table has deprecated Object columns#1416
mkmkme wants to merge 3 commits intoreleases/25.8.16from
mkmkme/object-fix

Conversation

@mkmkme
Copy link
Collaborator

@mkmkme mkmkme commented Feb 17, 2026

fixes #1412

Here's the analysis of #1412 by Claude:

 Root cause: The old Object('json') type converts JSON data to nested Tuple structures before storage. When parts have different JSON schemas, reading subcolumns from compact parts without per-substream marks fails — the compact
 reader's deserialization can't properly handle the complex nested type serialization, leading to tuple elements being deserialized with mismatched sizes.

 Crash: Logical error: 'Unexpected size of tuple element 1: 0. Expected size: 1' in SerializationTuple::deserializeBinaryBulkWithMultipleStreams

 Recommended Fix: Force wide parts for tables with deprecated Object columns

 In MergeTreeData::choosePartFormat, detect tables with deprecated Object columns and always choose Wide format. Wide parts work correctly with all ClickHouse versions and handle complex nested types properly.

 This is clean and targeted because:
 - Only affects tables using the deprecated Object('json') type (narrow scope)
 - The enum ordering (Wide=0 < Compact=1) means std::min in merge logic will pick Wide when choosePartFormat returns it, so even existing compact parts get rewritten to Wide during natural merges
 - No changes needed to the complex compact reader deserialization code

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • Tiered Storage (2h)

…bject columns

fixes #1412

Here's the analysis of #1412 by Claude:

     Root cause: The old Object('json') type converts JSON data to nested Tuple structures before storage. When parts have different JSON schemas, reading subcolumns from compact parts without per-substream marks fails — the compact
     reader's deserialization can't properly handle the complex nested type serialization, leading to tuple elements being deserialized with mismatched sizes.

     Crash: Logical error: 'Unexpected size of tuple element 1: 0. Expected size: 1' in SerializationTuple::deserializeBinaryBulkWithMultipleStreams

     Recommended Fix: Force wide parts for tables with deprecated Object columns

     In MergeTreeData::choosePartFormat, detect tables with deprecated Object columns and always choose Wide format. Wide parts work correctly with all ClickHouse versions and handle complex nested types properly.

     This is clean and targeted because:
     - Only affects tables using the deprecated Object('json') type (narrow scope)
     - The enum ordering (Wide=0 < Compact=1) means std::min in merge logic will pick Wide when choosePartFormat returns it, so even existing compact parts get rewritten to Wide during natural merges
     - No changes needed to the complex compact reader deserialization code
@mkmkme mkmkme added bugfix 25.8 25.8 Altinity Stable 25.8.16 25.8.16 Stable labels Feb 17, 2026
@github-actions
Copy link

github-actions bot commented Feb 17, 2026

Workflow [PR], commit [0cb21ed]

@mkmkme
Copy link
Collaborator Author

mkmkme commented Feb 17, 2026

@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: afbc938189

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mkmkme
Copy link
Collaborator Author

mkmkme commented Feb 17, 2026

@codex review

@svb-alt svb-alt added the 25.8.16.10001 25.8.16.10001 Stable label Feb 17, 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: 0cb21ed200

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mkmkme
Copy link
Collaborator Author

mkmkme commented Feb 17, 2026

@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: ac88a154f1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

25.8 25.8 Altinity Stable 25.8.16 25.8.16 Stable 25.8.16.10001 25.8.16.10001 Stable bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants