fix: 判断导入数据执行结果

This commit is contained in:
taojinlong 2021-06-03 15:10:54 +08:00
parent 9d142bcfc8
commit 48069f563f
2 changed files with 14 additions and 1 deletions

View File

@ -112,7 +112,17 @@ public class ExtractDataService {
"PROPERTIES(\"replication_num\" = \"1\");"; "PROPERTIES(\"replication_num\" = \"1\");";
private static String dropTableSql = "DROP TABLE IF EXISTS TABLE_NAME;"; private static String dropTableSql = "DROP TABLE IF EXISTS TABLE_NAME;";
private static String shellScript = "curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load\n" + private static String shellScript = "result=`curl --location-trusted -u %s:%s -H \"label:%s\" -H \"column_separator:%s\" -H \"columns:%s\" -H \"merge_type: %s\" -T %s -XPUT http://%s:%s/api/%s/%s/_stream_load`\n" +
"if [ $? == 0 ] ; then\n" +
" failstatus=$(echo $result | grep '\"Status\": \"Fail\"')\n" +
" if [[ \"$failstatus\" != \"\" ]]; then\n" +
" echo $result\n" +
" exit 1\n" +
" fi\n" +
"else\n" +
" echo $result\n" +
" exit 1\n" +
"fi\n" +
"rm -rf %s\n"; "rm -rf %s\n";
private String createDorisTablColumnSql(List<DatasetTableField> datasetTableFields) { private String createDorisTablColumnSql(List<DatasetTableField> datasetTableFields) {
String Column_Fields = "dataease_uuid varchar(50), `"; String Column_Fields = "dataease_uuid varchar(50), `";

View File

@ -461,8 +461,11 @@ export default {
post('/dataset/table/incrementalConfig', { tableId: this.table.id }).then(response => { post('/dataset/table/incrementalConfig', { tableId: this.table.id }).then(response => {
this.incrementalConfig = response.data this.incrementalConfig = response.data
this.incrementalUpdateType = 'incrementalAdd' this.incrementalUpdateType = 'incrementalAdd'
console.log(this.sql);
if (this.incrementalConfig.incrementalAdd) { if (this.incrementalConfig.incrementalAdd) {
this.sql = this.incrementalConfig.incrementalAdd this.sql = this.incrementalConfig.incrementalAdd
}else {
this.sql = ''
} }
}) })
}, },