-
Notifications
You must be signed in to change notification settings - Fork 54
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
Added a config parameter auto.create.tables.replicated
#345
Conversation
…s replicated tables creation. In this logic I use a separate config parameter `use.replacingmergetree.is_deleted.column` as a flag to manage tables creation. If `true` - use `is_deleted` column if supported, otherwise use `_sign`.
@@ -75,12 +90,42 @@ public java.lang.String createTableSyntax(ArrayList<String> primaryKey, String t | |||
//createTableSyntax.deleteCharAt(createTableSyntax.lastIndexOf(",")); | |||
|
|||
// Append sign and version columns | |||
createTableSyntax.append("`").append(SIGN_COLUMN).append("` ").append(SIGN_COLUMN_DATA_TYPE).append(","); | |||
String DeleteColumnNameFinal = this.userDefinedDeleteColumnName; |
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.
please use camel case for variables.
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.
DeleteColumnNameFinal is not a constant, and it should not start with upper case.
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, my bad, sorry)
createTableSyntax.append(")"); | ||
createTableSyntax.append(" "); | ||
createTableSyntax.append("ENGINE = ReplacingMergeTree(").append(VERSION_COLUMN).append(")"); | ||
createTableSyntax.append("ENGINE = "); |
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.
Please update unit tests in ClickHouseAutoCreateTableTest.
In my environment I use |
This feature was implemented as part of other PRs , closing this for now. |
Solution for #62. Added a config parameter
auto.create.tables.replicated
that controls replicated tables creation.In this logic I use a separate config parameter
use.replacingmergetree.is_deleted.column
as a flag to manage tables creation. Iftrue
- useis_deleted
column if supported, otherwise use_sign
.