youngoli commented on a change in pull request #13760:
URL: https://github.com/apache/beam/pull/13760#discussion_r558785794



##########
File path: sdks/go/pkg/beam/core/runtime/graphx/schema/schema.go
##########
@@ -83,12 +98,34 @@ func registerType(ut reflect.Type, seen 
map[reflect.Type]struct{}) {
 
        // Lets do some recursion to register fundamental type parts.
        t := ut
+
+       if lID, ok := r.logicalTypeIdentifiers[t]; ok {
+               lt := r.logicalTypes[lID]
+               r.addToMaps(lt.StorageType(), t)
+               return
+       }
+       for _, lti := range r.logicalTypeInterfaces {
+               if !t.Implements(lti) {
+                       continue
+               }
+               p := r.logicalTypeProviders[lti]
+               st, err := p(t)
+               if err != nil {
+                       panic(errors.Wrapf(err, "unable to convert 
LogicalType[%v] using provider for %v", t, lti))
+               }
+               if st == nil {
+                       continue
+               }
+               r.RegisterLogicalType(ToLogicalType(t.String(), t, st))
+               r.addToMaps(st, t)

Review comment:
       Should this be returning here, like you do when finding for an existing 
logicalType above?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to