Skip to content

register(): make underscore legal in column name - #1867

Closed
averemee-si wants to merge 1 commit into
ClickHouse:mainfrom
averemee-si:patch-1
Closed

averemee-si wants to merge 1 commit into
ClickHouse:mainfrom
averemee-si:patch-1

Conversation

@averemee-si

Copy link
Copy Markdown

Summary

fix for [client-v2] Underscore in column name is removed

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@CLAassistant

CLAassistant commented Oct 11, 2024 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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 _.

@chernser

chernser commented Oct 15, 2024 •

Copy link
Copy Markdown
Contributor

I'm closing this PR because it solves only part of the problem. Out team will work on the fix and will create a new PR for this issue.

@chernser chernser closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants