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
[Improve](schemaChange)schema change ddl supports multi-column changes, synchronous defaults #167
Conversation
@@ -245,7 +245,7 @@ under the License. | |||
<dependency> | |||
<groupId>com.ververica</groupId> | |||
<artifactId>flink-sql-connector-mysql-cdc</artifactId> | |||
<version>2.3.0</version> | |||
<version>2.4.1</version> |
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.
Will 2.4.1 conflict with oracle2.3.0?
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 problem occurs when running the CdcOraclelSyncDatabaseCase
class alone
return null; | ||
} | ||
// Due to historical reasons, doris needs to add quotes to the default value of the new column | ||
if (Pattern.matches("['\"].*?['\"]", defaultValue)) { |
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.
It is recommended to write an example on the comments
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.
Of course, I've added.
public static final String ADD_DDL = "ALTER TABLE %s ADD COLUMN %s %s"; | ||
public static final String DROP_DDL = "ALTER TABLE %s DROP COLUMN %s"; |
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.
only saw add and drop column, how is rename implemented?
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.
Rename is currently not supported, the rename statement will be filtered, and doris will not execute it.
return success; | ||
} | ||
|
||
private List<String> extractDDLList(JsonNode record) throws JsonProcessingException { |
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.
Need to add unit tests
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.
Thanks for your suggestion, I have changed.
@@ -277,6 +371,68 @@ private String authHeader() { | |||
return "Basic " + new String(Base64.encodeBase64((dorisOptions.getUsername() + ":" + dorisOptions.getPassword()).getBytes(StandardCharsets.UTF_8))); | |||
} | |||
|
|||
private void fillOriginSchema(JsonNode columns) { |
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.
the same as above
@@ -71,8 +71,9 @@ public static void main(String[] args) throws Exception{ | |||
String includingTables = "test.*"; | |||
String excludingTables = ""; | |||
boolean ignoreDefaultValue = false; | |||
boolean useNewSchemaChange = false; |
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.
Can schema change be execute in oracle?
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.
oracle currently does not support.
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
Proposed changes
The old schema change need to use regular expressions to match, resulting in comparison limitations.
The new schema change:
MySQL multi-table import enables new schema change only by configuring
--use-new-schema-change
, oracle does not currently supportProblem Summary:
Describe the overview of changes.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...