|
|
@ -42,6 +42,8 @@ public class DataxUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_READER_PLUGIN_RDBMS = "rdbmsreader"; |
|
|
|
public static final String DATAX_READER_PLUGIN_RDBMS = "rdbmsreader"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_READER_PLUGIN_OCEANBASE = "oceanbasev10reader"; |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_MYSQL = "mysqlwriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_MYSQL = "mysqlwriter"; |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_POSTGRESQL = "postgresqlwriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_POSTGRESQL = "postgresqlwriter"; |
|
|
@ -55,6 +57,8 @@ public class DataxUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_RDBMS = "rdbmswriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_RDBMS = "rdbmswriter"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_OCEANBASE = "oceanbasev10writer"; |
|
|
|
|
|
|
|
|
|
|
|
public static String getReaderPluginName(DbType dbType) { |
|
|
|
public static String getReaderPluginName(DbType dbType) { |
|
|
|
switch (dbType) { |
|
|
|
switch (dbType) { |
|
|
|
case MYSQL: |
|
|
|
case MYSQL: |
|
|
@ -67,6 +71,8 @@ public class DataxUtils { |
|
|
|
return DATAX_READER_PLUGIN_SQLSERVER; |
|
|
|
return DATAX_READER_PLUGIN_SQLSERVER; |
|
|
|
case CLICKHOUSE: |
|
|
|
case CLICKHOUSE: |
|
|
|
return DATAX_READER_PLUGIN_CLICKHOUSE; |
|
|
|
return DATAX_READER_PLUGIN_CLICKHOUSE; |
|
|
|
|
|
|
|
case OCEANBASE: |
|
|
|
|
|
|
|
return DATAX_READER_PLUGIN_OCEANBASE; |
|
|
|
case HIVE: |
|
|
|
case HIVE: |
|
|
|
case PRESTO: |
|
|
|
case PRESTO: |
|
|
|
default: |
|
|
|
default: |
|
|
@ -88,6 +94,8 @@ public class DataxUtils { |
|
|
|
return DATAX_WRITER_PLUGIN_CLICKHOUSE; |
|
|
|
return DATAX_WRITER_PLUGIN_CLICKHOUSE; |
|
|
|
case DATABEND: |
|
|
|
case DATABEND: |
|
|
|
return DATAX_WRITER_PLUGIN_DATABEND; |
|
|
|
return DATAX_WRITER_PLUGIN_DATABEND; |
|
|
|
|
|
|
|
case OCEANBASE: |
|
|
|
|
|
|
|
return DATAX_WRITER_PLUGIN_OCEANBASE; |
|
|
|
case HIVE: |
|
|
|
case HIVE: |
|
|
|
case PRESTO: |
|
|
|
case PRESTO: |
|
|
|
default: |
|
|
|
default: |
|
|
@ -116,6 +124,13 @@ public class DataxUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static SQLStatementParser getSqlStatementParser(String compatibleMode, String sql) { |
|
|
|
|
|
|
|
if (compatibleMode.toLowerCase().equals(DbType.ORACLE.getName())) { |
|
|
|
|
|
|
|
return new OracleStatementParser(sql); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return new MySqlStatementParser(sql); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static String[] convertKeywordsColumns(DbType dbType, String[] columns) { |
|
|
|
public static String[] convertKeywordsColumns(DbType dbType, String[] columns) { |
|
|
|
if (columns == null) { |
|
|
|
if (columns == null) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -152,6 +167,8 @@ public class DataxUtils { |
|
|
|
return String.format("`%s`", column); |
|
|
|
return String.format("`%s`", column); |
|
|
|
case DATABEND: |
|
|
|
case DATABEND: |
|
|
|
return String.format("`%s`", column); |
|
|
|
return String.format("`%s`", column); |
|
|
|
|
|
|
|
case OCEANBASE: |
|
|
|
|
|
|
|
return String.format("`%s`", column); |
|
|
|
default: |
|
|
|
default: |
|
|
|
return column; |
|
|
|
return column; |
|
|
|
} |
|
|
|
} |
|
|
|