Uh oh!
There was an error while loading. Please reload this page.
[BEAM-9044] Protobuf options to Schema options - #10529
Conversation
d984367 to
7a2dbacCompare7a2dbac to
4eb8f25Compare4eb8f25 to
c6578d0Compare7aa174e to
ccc7eb1Compare31da15f to
d5f3bf3Comparealexvanboxel
commented
Mar 19, 2020
Run Java_Examples_Dataflow PreCommit |
1 similar comment
alexvanboxel
commented
Mar 23, 2020
Run Java_Examples_Dataflow PreCommit |
alexvanboxel
commented
Mar 23, 2020
@reuvenlax friendly ping |
There was a problem hiding this comment.
We want to switch this metadata to use options. However you are translating proto option names directly to field names, which means there's no guarantee that these other options won't conflict. Maybe prefix all of these options with something to prevent potential conflict?
There was a problem hiding this comment.
We want to switch this metadata to use options. However you are translating proto option names directly to field names, which means there's no guarantee that these other options won't conflict. Maybe prefix all of these options with something to prevent potential conflict?
What about beam:option:proto:, that would make an proto option vptech.data.v1.description into beam:option:proto:vptech.data.v1.description. Making it a URI format
beam:option : fixed prefix for options, proto : for the extension (will be avro for avro), vptech.data.v1 package of the extension and desciption the proto extension field.
There was a problem hiding this comment.
I think Reuven was referring to the metadata that's added in withMetaData, since that's the "special" proto metadata
There was a problem hiding this comment.
Is it, I don't think so... because I told Reuven I would do metadata after this. Still I think it's a good idea... and with your comment I want to revise the URI:
beam:option:proto:field:vptech.data.v1.descriptionfor a proto field optionbeam:option:proto:message:vptech.data.v1.descriptionfor a proto message optionbeam:option:proto:meta:numberfor a proto field numberbeam:option:proto:meta:type_namefor a proto type name
WDYT?
There was a problem hiding this comment.
I don't want to force all Beam option names to have a prefix - I think that's the wrong approach. I'm suggesting that we create well-known prefixes for these proto options (when translated to Beam options), so we can distinguish them from other options. The prefixes you suggested sound fine to me.
There was a problem hiding this comment.
Now all the options are prefix. I moved the removal of the metadata to another ticket, because it's more involved:
[BEAM-9604] BIP-1: Remove schema metadata usage for Protobuf extension
There was a problem hiding this comment.
As mentioned above, I think we should add a well-known prefix here.
alexvanboxel
commented
Mar 25, 2020
Run Java PreCommit |
alexvanboxel
commented
Mar 25, 2020
Run Java PreCommit |
496d77a to
f7185f6Comparealexvanboxel
commented
Mar 27, 2020
@reuvenlax if you don't have remarks (removing metadata will be in another PR) I can make a private build of master. I got a pipeline full of schema aware stuff to test this on. |
alexvanboxel
commented
Mar 28, 2020
Run Java PreCommit |
alexvanboxel
commented
Mar 28, 2020
I've decided to add the removal of metadata usage in the proto implementation as an additional commit, this makes the PR bigger but it also makes it complete. The option based storing of proto number and message name makes it much cleaner then the removed metadata based one. |
alexvanboxel
commented
Apr 2, 2020
@reuvenlax friendly reminder for reviewing the changes. It would be great if this would make the release (2.21) that will be cut in 6 days. |
reuvenlax
commented
Apr 2, 2020
LGTM |
Convert protobuf options to Row schema options. It gets the options from a proto message descriptor and converts them into beam schema options on the Schema. It does the same from proto field descriptors, converting them into beam field options. The converter creates typed options as the proto options are also fully typed. For the convertion it uses the ProtoDynamicSchema to resolve the types.
a7d7492 to
e741380Comparealexvanboxel
commented
Apr 3, 2020
Thanks, now I can start working on the next parts and think about documentation. Hooray! |
[BEAM-9044] Protobuf options to Schema options
Convert protobuf options to Row schema options. It gets the options from a proto message descriptor and converts them into beam schema options on the Schema. It does the same from proto field descriptors, converting them into beam field options.
The converter creates typed options as the proto options are also fully typed. For the convertion it uses the ProtoDynamicSchema to resolve the types.
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.