Skip to content

Commit

Permalink
Merge pull request #7537 from dolthub/daylon/extended-changes
Browse files Browse the repository at this point in the history
Fixed handler bug related to ExtendedTypes
  • Loading branch information
Hydrocharged authored Feb 28, 2024
2 parents 1eab16f + e7d344b commit 6ec6d86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 6ec6d86

Please sign in to comment.