-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-8111] Enable CloudObjectsTest$DefaultCoders #9446
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
99bea04
add assert that always fails to check if CloudObjectsTest ever runs
TheNeuralBit 71b4531
Remove forced failures and add Enclosed annotation
TheNeuralBit 8fb836b
Fix some simple test failures
TheNeuralBit d9f298e
Use components rather than coder arguments for structured coders
TheNeuralBit a6c768a
Add StringUtf8Coder, DoubleCoder to the list of Dataflow known coders
TheNeuralBit b1a07f7
add equals and hashCode to SchemaCoder/RowCoder
TheNeuralBit bd773b8
!fixup remove unused import
TheNeuralBit 1da2f1e
!fixup formatting
TheNeuralBit b858ccf
Add SchemaCoder test with an actual schema
TheNeuralBit 5528e0d
Remove StringUtf8Coder from dataflow known coders
TheNeuralBit 2177bcb
SchemaCoder.equals compares fromRow/toRow, make row identity funcs ha…
TheNeuralBit 29a6efc
formatting
TheNeuralBit 40eb928
Merge remote-tracking branch 'origin/master' into cloud-objects-test
TheNeuralBit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this just revert to object equality comparison on the to/from functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - I discussed this offline a bit with @kennknowles and he convinced me that it was better to have an equals function that might have some false negatives (if the toRowFunction and fromRowFunction don't have a good equals), rather than one that could have false positives (like if we rely on just checking the schema and typeDescriptor, and assume that the toRow/fromRow are the same).
I managed to make the CloudObjectsTest work by adding RowIdentity with an equals() function here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I would phrase this is: let the functions own their equals. If they say they are equal, they are. If they say they aren't, they aren't. So this equals() is relative to that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good in theory. In practice these functions are usually lambdas, so we might have trouble making this work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. I was thinking it's not such a big deal to get false negatives when lambdas are used, since I really just want the equality check to use in tests.
What do you think about updating the various schema providers to create Function sub-classes (with equals implemented) instead of using lambdas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another alternative could be to add something like
assertEquivalentSchemaCoderthat just checks schema and type, rather than continuing down this rabbit hole.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we go ahead and merge this as is? I could follow up with more changes to the SchemaCoder equals (plumbing through a type descriptor and using that for comparison, as well as possibly changing the toRow/fromRow functions created by the existing SchemaProviders to make them comparable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a PR up now (#9493) that adds
equalsandhashCodeto thefromRowandtoRowfunctions created by all theGetterBasedSchemaProvidersub-classes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW this is not just for tests. The Flink runner appears to rely on coder equality (even though you can argue it shouldn't).