Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed handler bug related to ExtendedTypes #7537

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions go/store/prolly/artifact_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ type Artifact struct {
}

func mergeArtifactsDescriptorsFromSource(srcKd val.TupleDesc) (kd, vd val.TupleDesc) {

// artifact key consists of keys of source schema, followed by target branch
// commit hash, and artifact type.
keyTypes := srcKd.Types
Expand All @@ -601,7 +600,11 @@ func mergeArtifactsDescriptorsFromSource(srcKd val.TupleDesc) (kd, vd val.TupleD
// json blob data
valTypes := []val.Type{{Enc: val.JSONEnc, Nullable: false}}

return val.NewTupleDescriptor(keyTypes...), val.NewTupleDescriptor(valTypes...)
// Add empty handlers for the new types
handlers := make([]val.TupleTypeHandler, len(keyTypes))
copy(handlers, srcKd.Handlers)

return val.NewTupleDescriptorWithArgs(val.TupleDescriptorArgs{Handlers: handlers}, keyTypes...), val.NewTupleDescriptor(valTypes...)
}

func ArtifactDebugFormat(ctx context.Context, m ArtifactMap) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion go/store/val/extended_comparator.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (c ExtendedTupleComparator) Validated(types []Type) TupleComparator {
switch types[i].Enc {
case ExtendedEnc, ExtendedAddrEnc:
if handler == nil {
panic("extende encoding requires a handler")
panic("extended encoding requires a handler")
} else {
hasHandler = true
}
Expand Down
Loading