Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Jul 24, 2025

I'm not 100% how to repro this, but there is definitely something up with the Union and Intersect logic in stats histograms.
Based on the stack trace, there's a panic when attempting to Union histogram buckets.

It seems like the logic assumes that the histogram keys are always shorter than the number of buckets.
This PR fixes the Union and Intersect logic to compare the keys without the assumption, and adds some unit tests.

fixes: dolthub/dolt#9143

@jycor jycor changed the title fix panic in stats histogram merging fix panic in stats histogram union and intersect Jul 24, 2025
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

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

Looks good!

@jycor jycor merged commit 9929479 into main Jul 24, 2025
8 checks passed
@jycor jycor deleted the james/histogram branch July 24, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

index out of range panic on CTE

3 participants