Skip to content

Conversation

@mtabebe
Copy link
Contributor

@mtabebe mtabebe commented Feb 11, 2026

Problem:

Panics arise in the execution/optimization with empty int2vector's

ERROR:  internal error: internal error in optimizer: internal transform error
int2vector dimensions differ: got datum with dimension 0, expected dimension 1

Solution:

Introduce has_int2vector_dims which validates either the array is 1-dimensional, or 0 dimensional, and empty. Use this in 3 places where checked

Testing:

New tests in int2vector.slt that test empty int2vector's, or rows with empty vector's

Motivation

https://github.com/MaterializeInc/database-issues/issues/10057

@mtabebe mtabebe requested review from a team as code owners February 11, 2026 02:12
@mtabebe mtabebe requested a review from ohbadiah February 11, 2026 02:12
@github-actions
Copy link

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

@mtabebe mtabebe requested review from ggevay and removed request for a team and ohbadiah February 11, 2026 02:12
Comment on lines 51 to 56
/// Returns true if this array's dimensions are valid for the Int2Vector type.
/// Int2Vector is 1-D; empty arrays use 0 dimensions (PostgreSQL convention).
pub fn has_int2vector_dims(array: &Array<'_>) -> bool {
array.dims().len() == 1 || (array.dims().len() == 0 && array.elements().iter().next().is_none())
}

Copy link
Member

Choose a reason for hiding this comment

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

Can we make this a function on Array? It's hard to keep track of free standing functions, and this seems to be highly specific to arrays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, there didn't seem to be a ton of function on the Array struct. But I'm happy to move it.

@mtabebe mtabebe force-pushed the ma/10057/int2vec-dims branch from 6416405 to 01aa3e6 Compare February 11, 2026 13:40
@mtabebe mtabebe requested a review from antiguru February 11, 2026 14:10
@mtabebe mtabebe force-pushed the ma/10057/int2vec-dims branch from 01aa3e6 to 09c7f48 Compare February 11, 2026 18:13
Problem:
Panic arise in the execution/optimization with empty int2vector's
```
ERROR:  internal error: internal error in optimizer: internal transform error
int2vector dimensions differ: got datum with dimension 0, expected dimension 1
```

Solution:
Introduce has_int2vector_dims which validates either the array is
1-dimensional, or 0 dimensional, and empty. Use this in 3 places where
checked

Testing:
New tests in int2vector.slt that test empty int2vector's, or rows with
empty vector's
@mtabebe mtabebe force-pushed the ma/10057/int2vec-dims branch from 09c7f48 to a0a92bc Compare February 11, 2026 18:32
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.

2 participants