-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add missing defaultValue for ColumnMetadata.Builder #27503
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
base: master
Are you sure you want to change the base?
Conversation
9273946 to
1122d81
Compare
| { | ||
| this.name = columnMetadata.getName(); | ||
| this.type = columnMetadata.getType(); | ||
| this.defaultValue = columnMetadata.getDefaultValue(); |
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.
just this.defaultValue = columnMetadata.getDefaultValue(); is enough (pushed a fix to your branch)
can you please add a test that Builder(ColumnMetada).build() roundtrips?
1122d81 to
2ac0aca
Compare
| ColumnMetadata originColumnMetadata = ColumnMetadata.builder() | ||
| .setName("test_column") | ||
| .setType(INTEGER) | ||
| .setDefaultValue(Optional.of("1")) | ||
| .setNullable(false) | ||
| .setComment(Optional.ofNullable("test_comment")) | ||
| .setExtraInfo(Optional.of("test_extra_info")) | ||
| .setHidden(false) | ||
| .setProperties(ImmutableMap.of("test_key", "test_value")) | ||
| .build(); |
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.
Make ColumnMetadata constructor package private, @VisibleForTesting and call here.
This would ensure the test stays up to date, should there any new fields be added.
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.
ok, @VisibleForTesting will need guava dependency. I add a doc rather than add dependency. what do you think?
2ac0aca to
de3fbce
Compare
Description
Add missing defaultValue for ColumnMetadata.Builder
Release notes
(X) This is not user-visible or is docs only, and no release notes are required.