Skip to content

sql: Force MRE::typ() to return canonical repr types#35003

Merged
ggevay merged 4 commits intoMaterializeInc:mainfrom
mgree:repr-types-takeover-typ
Feb 13, 2026
Merged

sql: Force MRE::typ() to return canonical repr types#35003
ggevay merged 4 commits intoMaterializeInc:mainfrom
mgree:repr-types-takeover-typ

Conversation

@mgree
Copy link
Contributor

@mgree mgree commented Feb 13, 2026

Motivation

#27239

Description

Changes MirRelationExpr::typ() to actually do repr type inference, not SQL type. While it still returns a SQL type (to be fixed in a later PR), it's a canonical SQL type, obtained by mapping repr types back up to SQL types.

This draft PR is on top of #35005, which should merge first.

Verification

Currently WIP.

Will with nightly that #34958 successfully avoids all panics.

@github-actions
Copy link

github-actions bot commented Feb 13, 2026

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).

…e nullability correctly, add regression test
@mgree mgree force-pushed the repr-types-takeover-typ branch from 0cf937b to 78896a8 Compare February 13, 2026 19:20
@mgree mgree force-pushed the repr-types-takeover-typ branch 2 times, most recently from 742754c to 99e42eb Compare February 13, 2026 19:33
@mgree
Copy link
Contributor Author

mgree commented Feb 13, 2026

earlier nightly run that desynced after pyfmt force-push 😅

https://buildkite.com/materialize/nightly/builds/15144

@mgree mgree requested a review from ggevay February 13, 2026 19:37
@mgree mgree marked this pull request as ready for review February 13, 2026 19:39
@mgree mgree requested a review from a team as a code owner February 13, 2026 19:39
@mgree mgree force-pushed the repr-types-takeover-typ branch from 99e42eb to aa476af Compare February 13, 2026 19:53
ggevay pushed a commit that referenced this pull request Feb 13, 2026
)

### Motivation

#34958 removed many
possible panics;
#35003 sussed out
another.

### Description

We should only panic when types well and truly don't match---if SQL
types don't align but repr types do, there is no possibility of runtime
error.

### Verification

Nightly, baby! This failure got sussed out by
#35003, which pushes
repr types into many new locations---it is likely not a reachable
failure in the existing code.
@ggevay
Copy link
Contributor

ggevay commented Feb 13, 2026

Green! One more random Nightly run: https://buildkite.com/materialize/nightly/builds/15146

@ggevay ggevay merged commit 49c92e4 into MaterializeInc:main Feb 13, 2026
142 of 143 checks passed
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