-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Sort SchemaTransform configuration schema fields by name to establish consistency #24344
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
|
R: @chamikaramj |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control |
chamikaramj
left a comment
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.
Thanks.
.../core/src/main/java/org/apache/beam/sdk/schemas/transforms/TypedSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
.../core/src/main/java/org/apache/beam/sdk/schemas/transforms/TypedSchemaTransformProvider.java
Outdated
Show resolved
Hide resolved
|
Let's also create a Github issue to track this. |
4961a0a to
d3d7f7b
Compare
|
R: @chamikaramj |
|
Fixes #24361 |
chamikaramj
left a comment
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.
Thanks.
| @Internal | ||
| @Experimental(Kind.SCHEMAS) | ||
| @SuppressWarnings({ | ||
| "nullness" // TODO(https://github.com/apache/beam/issues/20506) |
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.
What's the error you got here ? We should try to fix checker-framework warnings in new code instead of surpassing.
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.
No longer running into this now that sorting method is in Schema.java, will remove
|
|
||
| /** Returns an identical Schema with sorted fields. */ | ||
| public Schema sorted() { | ||
| Schema sortedSchema = |
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.
Can we add an assertion or a unit test that will break if any new properties are added to the Schema object that are not copied over 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.
Done, PTAL
chamikaramj
left a comment
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.
LGTM. Thanks.
|
Jacoco creates synthetic fields when it runs, which get picked up by |
|
Run Java PreCommit |
2 similar comments
|
Run Java PreCommit |
|
Run Java PreCommit |
TypedSchemaTransformProvider::configurationSchemareturns an inconsistently ordered Schema object. A consistent Schema is needed to use configuration Row objects to instantiate and build SchemaTransforms. The solution in this PR is to sort the fields by name.Fixes #24361