private String genTable(Table table) {
        String columnStrs = table.getColumns().stream()
                .map(column -> {
                    String unit = "";
                    if (column.getPrecision() != null
                            && column.getScale() != null
                            && column.getPrecision() > 0
                            && column.getScale() > 0) {
                        unit = String.format("(%s,%s)", column.getPrecision(), column.getScale());
                    } else if (null != column.getLength()) {
                        unit = String.format("(%s)", column.getLength());
                    }
                    // Avoid parsing mismatches when the numeric data type column declared by UNSIGNED/ZEROFILL keyword
                    String columnType = column.getType();

                    final String dv = column.getDefaultValue();
                    // If it defaults to a numeric type, there is no need to include single quotes or a bit type
                    String defaultValueTag = " DEFAULT '%s'";
                    if (NumberUtil.isNumber(dv)
                            || columnType.startsWith("bit")
                            || (StrUtil.isNotEmpty(dv)
                                    && dv.toLowerCase().trim().matches("^current_timestamp.*"))) {
                        defaultValueTag = " DEFAULT %s";
                    }
                    String defaultValue = Asserts.isNotNull(dv)
                            ? String.format(defaultValueTag, StrUtil.isEmpty(dv) ? "''" : dv)
                            : String.format("%s NULL ", !column.isNullable() ? " NOT " : "");

                    if (columnType.contains("unsigned") || columnType.contains("zerofill")) {
                        String[] arr = columnType.split(" ");
                        arr[0] = arr[0].concat(unit);
                        columnType = String.join(" ", arr);
                        unit = "";
                    }

                    return String.format(
                            "  `%s`  %s%s%s%s%s",
                            column.getName(),
                            columnType,
                            unit,
                            defaultValue,
                            column.isAutoIncrement() ? " AUTO_INCREMENT " : "",
                            Asserts.isNotNullString(column.getComment())
                                    ? String.format(" COMMENT '%s'", column.getComment())
                                    : "");
                })
                .collect(Collectors.joining(",\n"));

        List<String> columnKeys = table.getColumns().stream()
                .filter(Column::isKeyFlag)
                .map(Column::getName)
                .map(t -> String.format("`%s`", t))
                .collect(Collectors.toList());

        String primaryKeyStr = columnKeys.isEmpty()
                ? ""
                : columnKeys.stream().collect(Collectors.joining(",", ",\n  PRIMARY KEY (", ")\n"));

        return MessageFormat.format(
                "CREATE TABLE IF NOT EXISTS `{0}`.`{1}` (\n{2}{3})\n ENGINE={4}{5}{6};",
                table.getSchema(),
                table.getName(),
                columnStrs,
                primaryKeyStr,
                table.getEngine(),
                Asserts.isNotNullString(table.getOptions()) ? String.format(" %s", table.getOptions()) : "",
                Asserts.isNotNullString(table.getComment()) ? String.format(" COMMENT='%s'", table.getComment()) : "");
    }
@Test
    void genTable() {
        MySqlDriver sqlDriver = new MySqlDriver();
        String gen_table_sql = sqlDriver.getCreateTableSql(table);

        String expect = "CREATE TABLE IF NOT EXISTS `SchemaOrigin`.`TableNameOrigin` (\n"
                + "  `column1`  int NOT  NULL  COMMENT 'comment abc',\n"
                + "  `column2`  varchar NOT  NULL  COMMENT 'comment 'abc'',\n"
                + "  `column3`  double NOT  NULL  COMMENT 'comment \"abc\"',\n"
                + "  PRIMARY KEY (`column1`,`column2`)\n"
                + ")\n"
                + " ENGINE=null;";
        assertThat(gen_table_sql, equalTo(expect));
    }