Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ public synchronized void register(Class<?> clazz, TableSchema schema) {
boolean defaultsSupport = schema.hasDefaults();
tableSchemaHasDefaults.put(schemaKey, defaultsSupport);
for (ClickHouseColumn column : schema.getColumns()) {
String propertyName = column.getColumnName().toLowerCase().replace("_", "").replace(".", "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the purpose of this replacement is to leave only words without delimiting characters for easier compare.
For example, column name first_name should match getter method name firstName, that is why _ is removed.
If you have getters with underscores then is should be replaced from getter method name, too.
So current fix breaks canonical case when getters are without _.

String propertyName = column.getColumnName().toLowerCase().replace(".", "");
Method getterMethod = classGetters.get(propertyName);
if (getterMethod != null) {
schemaSerializers.put(column.getColumnName(), (obj, stream) -> {
Expand Down