Browse Source

[Fix-7459][Sqoop] running error in parallel (#7752)

* fix bug_7459

* fix bug_7459

* fix bug_7459

* fix bug_7459

* fix bug_7459

Co-authored-by: SbloodyS <sbloodys@qq.com>
3.0.0/version-upgrade
xiangzihao 3 years ago committed by GitHub
parent
commit
c58dbefaa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/targets/HiveTargetGenerator.java
  2. 12
      dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/parameter/targets/TargetHiveParameter.java
  3. 13
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue
  4. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  5. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

6
dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/generator/targets/HiveTargetGenerator.java

@ -27,6 +27,7 @@ import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_
import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_PARTITION_KEY; import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_PARTITION_KEY;
import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_PARTITION_VALUE; import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_PARTITION_VALUE;
import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_TABLE; import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.HIVE_TABLE;
import static org.apache.dolphinscheduler.plugin.task.sqoop.SqoopConstants.TARGET_DIR;
import static org.apache.dolphinscheduler.spi.task.TaskConstants.SPACE; import static org.apache.dolphinscheduler.spi.task.TaskConstants.SPACE;
import org.apache.dolphinscheduler.plugin.task.sqoop.generator.ITargetGenerator; import org.apache.dolphinscheduler.plugin.task.sqoop.generator.ITargetGenerator;
@ -91,6 +92,11 @@ public class HiveTargetGenerator implements ITargetGenerator {
.append(SPACE).append(targetHiveParameter.getHivePartitionValue()); .append(SPACE).append(targetHiveParameter.getHivePartitionValue());
} }
if (StringUtils.isNotEmpty(targetHiveParameter.getHiveTargetDir())) {
hiveTargetSb.append(SPACE).append(TARGET_DIR)
.append(SPACE).append(targetHiveParameter.getHiveTargetDir());
}
} }
} catch (Exception e) { } catch (Exception e) {
logger.error(String.format("Sqoop hive target params build failed: [%s]", e.getMessage())); logger.error(String.format("Sqoop hive target params build failed: [%s]", e.getMessage()));

12
dolphinscheduler-task-plugin/dolphinscheduler-task-sqoop/src/main/java/org/apache/dolphinscheduler/plugin/task/sqoop/parameter/targets/TargetHiveParameter.java

@ -54,6 +54,10 @@ public class TargetHiveParameter {
* hive partition value * hive partition value
*/ */
private String hivePartitionValue; private String hivePartitionValue;
/**
* hive target dir
*/
private String hiveTargetDir;
public String getHiveDatabase() { public String getHiveDatabase() {
return hiveDatabase; return hiveDatabase;
@ -118,4 +122,12 @@ public class TargetHiveParameter {
public void setHivePartitionValue(String hivePartitionValue) { public void setHivePartitionValue(String hivePartitionValue) {
this.hivePartitionValue = hivePartitionValue; this.hivePartitionValue = hivePartitionValue;
} }
public String getHiveTargetDir() {
return hiveTargetDir;
}
public void setHiveTargetDir(String hiveTargetDir) {
this.hiveTargetDir = hiveTargetDir;
}
} }

13
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue

@ -325,6 +325,18 @@
<el-switch v-model="targetHiveParams.hiveOverWrite" size="small"></el-switch> <el-switch v-model="targetHiveParams.hiveOverWrite" size="small"></el-switch>
</div> </div>
</m-list-box> </m-list-box>
<m-list-box>
<div slot="text">{{$t('Hive Target Dir')}}</div>
<div slot="content">
<el-input
:disabled="isDetails"
type="text"
size="small"
v-model="targetHiveParams.hiveTargetDir"
:placeholder="$t('Please enter hive target dir')">
</el-input>
</div>
</m-list-box>
<m-list-box> <m-list-box>
<div slot="text">{{$t('ReplaceDelimiter')}}</div> <div slot="text">{{$t('ReplaceDelimiter')}}</div>
<div slot="content"> <div slot="content">
@ -691,6 +703,7 @@
dropDelimiter: false, dropDelimiter: false,
hiveOverWrite: true, hiveOverWrite: true,
replaceDelimiter: '', replaceDelimiter: '',
hiveTargetDir: '',
hivePartitionKey: '', hivePartitionKey: '',
hivePartitionValue: '' hivePartitionValue: ''
}, },

1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -606,6 +606,7 @@ export default {
'Please enter Export Dir(required)': 'Please enter Export Dir(required)', 'Please enter Export Dir(required)': 'Please enter Export Dir(required)',
'Please enter Hive Database(required)': 'Please enter Hive Databasec(required)', 'Please enter Hive Database(required)': 'Please enter Hive Databasec(required)',
'Please enter Hive Table(required)': 'Please enter Hive Table(required)', 'Please enter Hive Table(required)': 'Please enter Hive Table(required)',
'Please enter hive target dir': 'Please enter hive target dir',
'Please enter Hive Partition Keys': 'Please enter Hive Partition Key', 'Please enter Hive Partition Keys': 'Please enter Hive Partition Key',
'Please enter Hive Partition Values': 'Please enter Partition Value', 'Please enter Hive Partition Values': 'Please enter Partition Value',
'Please enter Replace Delimiter': 'Please enter Replace Delimiter', 'Please enter Replace Delimiter': 'Please enter Replace Delimiter',

1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -606,6 +606,7 @@ export default {
'Please enter Export Dir(required)': '请输入数据源路径(必填)', 'Please enter Export Dir(required)': '请输入数据源路径(必填)',
'Please enter Hive Database(required)': '请输入Hive数据库(必填)', 'Please enter Hive Database(required)': '请输入Hive数据库(必填)',
'Please enter Hive Table(required)': '请输入Hive表名(必填)', 'Please enter Hive Table(required)': '请输入Hive表名(必填)',
'Please enter hive target dir': '请输入Hive临时目录',
'Please enter Hive Partition Keys': '请输入分区键', 'Please enter Hive Partition Keys': '请输入分区键',
'Please enter Hive Partition Values': '请输入分区值', 'Please enter Hive Partition Values': '请输入分区值',
'Please enter Replace Delimiter': '请输入替换分隔符', 'Please enter Replace Delimiter': '请输入替换分隔符',

Loading…
Cancel
Save