lostluck commented on issue #21929: URL: https://github.com/apache/beam/issues/21929#issuecomment-1159239495
Agreed, but unfortunately "Serializable" is not a real concept WRT Go, let alone as generics. As it stands, primitive types, and the Exported fields of structs (so, exactly like JSON's restrictions) are efficiently encoded using Beam schemas. Interfaces, Functions, Channels are not encodable because there's no good way of doing so, without the registration lookup tables (largely handled going forward with the register package Danny mentioned). Anything is serializable with enough prepwork though, via lookup tables or enums, or pre-known keys. It's simply difficult to make things work on distributed workers with only runtime knowledge otherwise. Aside from deferring to the standard proto.Marshaller for protocol buffer messages (determined via the proto interfaces), users can also register their own arbitrary coder functions (which also gets around the "exported fields" restrictions). You've already filed a task for us to improve the documentation for that escape hatch (#21930). -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
