-
Notifications
You must be signed in to change notification settings - Fork 956
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
CC-1878: Allow for case differences while finding missing columns #400
Conversation
It looks like @wicknicks hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here. Once you've signed reply with Appreciation of efforts, clabot |
65f7f25
to
e063363
Compare
Signed-off-by: Arjun Satish <arjun@confluent.io>
It looks like @wicknicks hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here. Once you've signed reply with Appreciation of efforts, clabot |
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.
A few suggestions.
|
||
if (columnNamesLowerCase.size() != dbColumnNames.size()) { | ||
log.warn("Table has column names which differ only with case sensitivity. Original " | ||
+ "columns={}", dbColumnNames); |
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.
Perhaps different wording:
Table has column names that differ from field names only by case. Original ...
@@ -172,6 +172,33 @@ boolean amendIfNecessary( | |||
missingFields.add(field); | |||
} | |||
} | |||
return missingFields; | |||
|
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.
Maybe return here if missingFields.isEmpty()
?
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.
This list is used to create ALTER table queries. So we need to return the set 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.
Right. If there are no missing fields at this point, why go through the work of checking case-insensitively? Why not return an empty list 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.
ah, missed that. sorry. fixed this.
Signed-off-by: Arjun Satish <arjun@confluent.io>
Signed-off-by: Arjun Satish <arjun@confluent.io>
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.
Signed-off-by: Arjun Satish arjun@confluent.io