|
|
@ -17,6 +17,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.plugin.task.datax; |
|
|
|
package org.apache.dolphinscheduler.plugin.task.datax; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.druid.sql.dialect.presto.parser.PrestoStatementParser; |
|
|
|
import org.apache.dolphinscheduler.spi.enums.DbType; |
|
|
|
import org.apache.dolphinscheduler.spi.enums.DbType; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseStatementParser; |
|
|
|
import com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseStatementParser; |
|
|
@ -39,7 +40,7 @@ public class DataxUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_READER_PLUGIN_CLICKHOUSE = "clickhousereader"; |
|
|
|
public static final String DATAX_READER_PLUGIN_CLICKHOUSE = "clickhousereader"; |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_READER_PLUGIN_HIVE = "rdbmsreader"; |
|
|
|
public static final String DATAX_READER_PLUGIN_RDBMS = "rdbmsreader"; |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_MYSQL = "mysqlwriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_MYSQL = "mysqlwriter"; |
|
|
|
|
|
|
|
|
|
|
@ -51,7 +52,7 @@ public class DataxUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_CLICKHOUSE = "clickhousewriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_CLICKHOUSE = "clickhousewriter"; |
|
|
|
|
|
|
|
|
|
|
|
public static final String DATAX_WRITER_PLUGIN_HIVE = "rdbmswriter"; |
|
|
|
public static final String DATAX_WRITER_PLUGIN_RDBMS = "rdbmswriter"; |
|
|
|
|
|
|
|
|
|
|
|
public static String getReaderPluginName(DbType dbType) { |
|
|
|
public static String getReaderPluginName(DbType dbType) { |
|
|
|
switch (dbType) { |
|
|
|
switch (dbType) { |
|
|
@ -66,7 +67,9 @@ public class DataxUtils { |
|
|
|
case CLICKHOUSE: |
|
|
|
case CLICKHOUSE: |
|
|
|
return DATAX_READER_PLUGIN_CLICKHOUSE; |
|
|
|
return DATAX_READER_PLUGIN_CLICKHOUSE; |
|
|
|
case HIVE: |
|
|
|
case HIVE: |
|
|
|
return DATAX_READER_PLUGIN_HIVE; |
|
|
|
return DATAX_READER_PLUGIN_RDBMS; |
|
|
|
|
|
|
|
case PRESTO: |
|
|
|
|
|
|
|
return DATAX_READER_PLUGIN_RDBMS; |
|
|
|
default: |
|
|
|
default: |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -85,7 +88,9 @@ public class DataxUtils { |
|
|
|
case CLICKHOUSE: |
|
|
|
case CLICKHOUSE: |
|
|
|
return DATAX_WRITER_PLUGIN_CLICKHOUSE; |
|
|
|
return DATAX_WRITER_PLUGIN_CLICKHOUSE; |
|
|
|
case HIVE: |
|
|
|
case HIVE: |
|
|
|
return DATAX_WRITER_PLUGIN_HIVE; |
|
|
|
return DATAX_WRITER_PLUGIN_RDBMS; |
|
|
|
|
|
|
|
case PRESTO: |
|
|
|
|
|
|
|
return DATAX_WRITER_PLUGIN_RDBMS; |
|
|
|
default: |
|
|
|
default: |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
@ -105,6 +110,8 @@ public class DataxUtils { |
|
|
|
return new ClickhouseStatementParser(sql); |
|
|
|
return new ClickhouseStatementParser(sql); |
|
|
|
case HIVE: |
|
|
|
case HIVE: |
|
|
|
return new HiveStatementParser(sql); |
|
|
|
return new HiveStatementParser(sql); |
|
|
|
|
|
|
|
case PRESTO: |
|
|
|
|
|
|
|
return new PrestoStatementParser(sql); |
|
|
|
default: |
|
|
|
default: |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|