public static String changeMysqlTableToClickHouse(String createTable) {
String tables = createTable;
String[] rows = tables.split("\n");
String replaceTables = "";
int i = 0;
String partition = "";
String orderBy = "";
for (String row : rows) {
if (row.contains("KEY")) {
continue;
}
if (row.contains("AUTO_INCREMENT,")) {
continue;
}
if (row.contains(") ENGINE=InnoDB")) {
row = ") ENGINE = MergeTree";
}
String changeRow = row.replaceAll("NOT NULL", "")
.replaceAll("AUTO_INCREMENT", "")
.replaceAll("CHARACTER SET utf8mb4", "")
.replaceAll("CHARACTER SET utf8", "")
.replaceAll("ON UPDATE CURRENT_TIMESTAMP", "")
.replaceAll("CURRENT_TIMESTAMP", "")
.r
mysql表结构转clickhouse
于 2021-06-03 11:53:30 首次发布