Skip to content

colinfo: add missing type families into CanHaveCompositeKeyEncoding#95839

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:tsvector-composite
Jan 26, 2023
Merged

colinfo: add missing type families into CanHaveCompositeKeyEncoding#95839
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:tsvector-composite

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

This commit adds several missing type families into CanHaveCompositeKeyEncoding method. Some of these type families are internal and, probably, don't need to be handled, but we recently introduced TSVector and TSQuery types which were incorrectly marked as being composite since they were not mentioned explicitly in the type family switch. This commit also makes it so that we panic in this method if we forget to include a newly-introduced type into this switch.

Fixes: #95680.

Release note: None

@yuzefovich yuzefovich requested review from a team and jordanlewis January 25, 2023 16:55
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)


pkg/sql/catalog/colinfo/column_type_properties.go line 92 at r1 (raw file):

	case types.UnknownFamily,
		types.AnyFamily:
		return true

I don't really understand why Unknown and Any are marked as composite here, but perhaps it doesn't matter that much.

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

LGTM

This commit adds several missing type families into
`CanHaveCompositeKeyEncoding` method. Some of these type families are
internal and, probably, don't need to be handled, but we recently
introduced TSVector and TSQuery types which were incorrectly marked as
being composite since they were not mentioned explicitly in the type
family switch. This commit also makes it so that we panic in this method
if we forget to include a newly-introduced type into this switch.

Release note: None
@yuzefovich
Copy link
Copy Markdown
Member Author

Thanks Jordan!

@cockroachdb/sql-schema I'd appreciate if someone took a look at this too.

@yuzefovich
Copy link
Copy Markdown
Member Author

Got an implicit LGTM from Andrew.

bors r+

@craig craig bot merged commit 32b5345 into cockroachdb:master Jan 26, 2023
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 26, 2023

Build succeeded:

@yuzefovich yuzefovich deleted the tsvector-composite branch January 26, 2023 23:00
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.

roachtest: unoptimized-query-oracle/disable-rules=all/rand-tables failed

3 participants