Skip to content

fix: clustered segment catalog spec complex handling - #19842

Open
clintropolis wants to merge 2 commits into
apache:masterfrom
clintropolis:fix-catalog-clustered-segments-complex-types
Open

fix: clustered segment catalog spec complex handling#19842
clintropolis wants to merge 2 commits into
apache:masterfrom
clintropolis:fix-catalog-clustered-segments-complex-types

Conversation

@clintropolis

Copy link
Copy Markdown
Member

Description

ClusteredValueGroupsBaseTableMetadata now checks for a complex DimensionHandler from a new method DimensionHandlerUtils#getComplexDimensionSchema which checks DIMENSION_HANDLER_PROVIDERS directly (instead of using the existing DimensionHandlerUtils#getHandlerFromCapabilities which now shares the underlying logic with this new method). DimensionSchemaUtils has also been updated to use this new method as it was already only calling getHandlerFromCapabilities for COMPLEX types.

@github-actions github-actions Bot added Area - Batch Ingestion Area - Segment Format and Ser/De Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels Jul 31, 2026

@FrankChen021 FrankChen021 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Severity Findings
P0 0
P1 0
P2 1
P3 0
Total 1

Reviewed 5 of 5 changed files.


This is an automated review by Codex GPT-5.6-Sol

// Other complex types cannot be ingested into a clustered base table: there is no dimension handler for them,
// and clustered base tables have no aggregators to produce them.
if (druidType.is(ValueType.COMPLEX)) {
return complexDimensionSchema(column.name(), druidType);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[P2] Reject handler schemas that change the declared type

This path accepts the provider's DimensionSchema without checking that schema.getColumnType() equals the catalog's declared complex type. The new test demonstrates the problem by declaring COMPLEX but producing a DoubleDimensionSchema. During ingestion, DimensionSchema.getDimensionHandler() then selects the double handler from that returned schema, so complex values fail conversion or are stored as a type that contradicts the sealed catalog schema. Apply the same type-consistency check used for custom schemas before accepting the provider result.

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

Labels

Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 Area - Segment Format and Ser/De Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants