-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-8146,BEAM-8204,BEAM-8205] Add equals and hashCode to SchemaCoder and RowCoder #9493
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
Conversation
796ce29 to
bab725d
Compare
|
Run Flink ValidatesRunner |
|
Run Apex ValidatesRunner |
|
Run Flink ValidatesRunner |
|
Run Apex ValidatesRunner |
also plumbs an instance through everywhere a SchemaCoder is created
…use they are failing" This reverts commit b9be6bb.
5176328 to
b0dd4d0
Compare
|
Run Apex ValidatesRunner |
|
Run Flink ValidatesRunner |
|
R: @reuvenlax I know you said Flink/Apex shouldn't be relying on coder equality and that should be the real fix for BEAM-8204 and BEAM-8205, but I think this is helpful for testing anyway. |
|
Run Flink ValidatesRunner |
|
Run Apex ValidatesRunner |
|
is this ready for review? |
|
Yep! |
|
Thing to watch out for is update (in)compatibility. It happened once when a contribution made a good refactor. |
|
Since it is already a CustomCoder hence not really update compatible, this is g2g after you resolve the rebase. |
|
Thanks @kennknowles, I resolved the merge conflicts so I think this is ready. It may be good to get a review from @reuvenlax before merging though, at least an approval of the high-level approach. Plumbing through the type descriptor and changing the |
|
Interesting. If toRow and fromRow are equal, is it possible for the type descriptor to be different? (other than, I suppose, loss of generics reflection information due to erasure) |
|
That's a good point, I don't think so. Initially I added the type descriptor as something we can verify as a proxy for |
|
I would say keep as-is. Being able to implement |
|
Given how long you've been waiting on this, I'm inclined to merge. Last chance to comment @reuvenlax ? |
|
+1 on merging @kennknowles |
typeDescriptorparameter to SchemaCoder, and plumbs through a descriptor everywhere instances are created (3bafcb0).GetterBasedSchemaProviderso that the toRow/fromRow functions it creates have a meaningful equals and hashCode function (d415795).equalsfunction to SchemaCoder that checks schema, typeDescriptor, fromRow, and toRow.GetterBasedSchemaProviderhas at least one test checking that toRow and fromRow are equal after serialization (36a6014).SchemaCoderTestwhich checks some instances ofSchemaCoderwithCoderProperties.{coderSerializable, coderConsistentWithEquals}(ab18bd5).AvroSchemaTest.testAvroPipelineGroupByfor Flink and Apex (17c2646).Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.