|
|
|
@ -640,77 +640,77 @@
|
|
|
|
|
|
|
|
|
|
sourceTypeList: [ |
|
|
|
|
{ |
|
|
|
|
code: "MYSQL" |
|
|
|
|
}, |
|
|
|
|
code: 'MYSQL' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
targetTypeList: [ |
|
|
|
|
{ |
|
|
|
|
code:"HIVE" |
|
|
|
|
code: 'HIVE' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code:"HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
|
|
|
|
|
sourceType:"MYSQL", |
|
|
|
|
targetType:"HDFS", |
|
|
|
|
sourceType: 'MYSQL', |
|
|
|
|
targetType: 'HDFS', |
|
|
|
|
|
|
|
|
|
sourceMysqlParams: { |
|
|
|
|
srcType:"MYSQL", |
|
|
|
|
srcDatasource:"", |
|
|
|
|
srcTable:"", |
|
|
|
|
srcQueryType:"1", |
|
|
|
|
srcType: 'MYSQL', |
|
|
|
|
srcDatasource: '', |
|
|
|
|
srcTable: '', |
|
|
|
|
srcQueryType: '1', |
|
|
|
|
srcQuerySql: '', |
|
|
|
|
srcColumnType:"0", |
|
|
|
|
srcColumns:"", |
|
|
|
|
srcColumnType: '0', |
|
|
|
|
srcColumns: '', |
|
|
|
|
srcConditionList: [], |
|
|
|
|
mapColumnHive: [], |
|
|
|
|
mapColumnJava: [] |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
sourceHdfsParams: { |
|
|
|
|
exportDir:"" |
|
|
|
|
exportDir: '' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
sourceHiveParams: { |
|
|
|
|
hiveDatabase:"", |
|
|
|
|
hiveTable:"", |
|
|
|
|
hivePartitionKey:"", |
|
|
|
|
hivePartitionValue:"" |
|
|
|
|
hiveDatabase: '', |
|
|
|
|
hiveTable: '', |
|
|
|
|
hivePartitionKey: '', |
|
|
|
|
hivePartitionValue: '' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
targetHdfsParams: { |
|
|
|
|
targetPath:"", |
|
|
|
|
targetPath: '', |
|
|
|
|
deleteTargetDir: true, |
|
|
|
|
fileType:"--as-avrodatafile", |
|
|
|
|
compressionCodec:"snappy", |
|
|
|
|
fieldsTerminated:"", |
|
|
|
|
linesTerminated:"", |
|
|
|
|
fileType: '--as-avrodatafile', |
|
|
|
|
compressionCodec: 'snappy', |
|
|
|
|
fieldsTerminated: '', |
|
|
|
|
linesTerminated: '' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
targetMysqlParams: { |
|
|
|
|
targetType:"MYSQL", |
|
|
|
|
targetDatasource:"", |
|
|
|
|
targetTable:"", |
|
|
|
|
targetColumns:"", |
|
|
|
|
fieldsTerminated:"", |
|
|
|
|
linesTerminated:"", |
|
|
|
|
preQuery:"", |
|
|
|
|
targetType: 'MYSQL', |
|
|
|
|
targetDatasource: '', |
|
|
|
|
targetTable: '', |
|
|
|
|
targetColumns: '', |
|
|
|
|
fieldsTerminated: '', |
|
|
|
|
linesTerminated: '', |
|
|
|
|
preQuery: '', |
|
|
|
|
isUpdate: false, |
|
|
|
|
targetUpdateKey:"", |
|
|
|
|
targetUpdateMode:"allowinsert" |
|
|
|
|
targetUpdateKey: '', |
|
|
|
|
targetUpdateMode: 'allowinsert' |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
targetHiveParams: { |
|
|
|
|
hiveDatabase:"", |
|
|
|
|
hiveTable:"", |
|
|
|
|
hiveDatabase: '', |
|
|
|
|
hiveTable: '', |
|
|
|
|
createHiveTable: false, |
|
|
|
|
dropDelimiter: false, |
|
|
|
|
hiveOverWrite: true, |
|
|
|
|
replaceDelimiter:"", |
|
|
|
|
hivePartitionKey:"", |
|
|
|
|
hivePartitionValue:"" |
|
|
|
|
replaceDelimiter: '', |
|
|
|
|
hivePartitionKey: '', |
|
|
|
|
hivePartitionValue: '' |
|
|
|
|
}, |
|
|
|
|
item: '', |
|
|
|
|
scriptBoxDialog: false |
|
|
|
@ -750,79 +750,79 @@
|
|
|
|
|
case 'import': |
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code:"MYSQL" |
|
|
|
|
}, |
|
|
|
|
code: 'MYSQL' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
case 'export': |
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code: "HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code: "HIVE" |
|
|
|
|
code: 'HIVE' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
this.sourceTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code:"MYSQL" |
|
|
|
|
code: 'MYSQL' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code:"HIVE" |
|
|
|
|
code: 'HIVE' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code:"HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_getTargetTypeList (data) { |
|
|
|
|
switch (data) { |
|
|
|
|
case 'MYSQL': |
|
|
|
|
if (this.srcQueryType === "1") { |
|
|
|
|
if (this.srcQueryType === '1') { |
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code: "HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
}] |
|
|
|
|
} else { |
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code: "HIVE" |
|
|
|
|
code: 'HIVE' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code: "HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code:"MYSQL" |
|
|
|
|
code: 'MYSQL' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
case 'HIVE': |
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code:"MYSQL" |
|
|
|
|
code: 'MYSQL' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
this.targetTypeList = [ |
|
|
|
|
{ |
|
|
|
|
code:"HIVE" |
|
|
|
|
code: 'HIVE' |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
code:"HDFS" |
|
|
|
|
code: 'HDFS' |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -856,23 +856,23 @@
|
|
|
|
|
_handleSourceParams () { |
|
|
|
|
var params = null |
|
|
|
|
switch (this.sourceType) { |
|
|
|
|
case "MYSQL": |
|
|
|
|
this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === "1" && editor ? |
|
|
|
|
editor.getValue() : this.sourceMysqlParams.srcQuerySql |
|
|
|
|
case 'MYSQL': |
|
|
|
|
this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === '1' && editor |
|
|
|
|
? editor.getValue() : this.sourceMysqlParams.srcQuerySql |
|
|
|
|
params = JSON.stringify(this.sourceMysqlParams) |
|
|
|
|
break; |
|
|
|
|
case "ORACLE": |
|
|
|
|
break |
|
|
|
|
case 'ORACLE': |
|
|
|
|
params = JSON.stringify(this.sourceOracleParams) |
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
params = JSON.stringify(this.sourceHdfsParams) |
|
|
|
|
break; |
|
|
|
|
case "HIVE": |
|
|
|
|
break |
|
|
|
|
case 'HIVE': |
|
|
|
|
params = JSON.stringify(this.sourceHiveParams) |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
params = ""; |
|
|
|
|
break; |
|
|
|
|
params = '' |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
return params |
|
|
|
|
}, |
|
|
|
@ -883,18 +883,18 @@
|
|
|
|
|
_handleTargetParams () { |
|
|
|
|
var params = null |
|
|
|
|
switch (this.targetType) { |
|
|
|
|
case "HIVE": |
|
|
|
|
case 'HIVE': |
|
|
|
|
params = JSON.stringify(this.targetHiveParams) |
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
params = JSON.stringify(this.targetHdfsParams) |
|
|
|
|
break; |
|
|
|
|
case "MYSQL": |
|
|
|
|
break |
|
|
|
|
case 'MYSQL': |
|
|
|
|
params = JSON.stringify(this.targetMysqlParams) |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
params = ""; |
|
|
|
|
break; |
|
|
|
|
params = '' |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return params |
|
|
|
@ -905,21 +905,21 @@
|
|
|
|
|
*/ |
|
|
|
|
_getSourceParams (data) { |
|
|
|
|
switch (this.sourceType) { |
|
|
|
|
case "MYSQL": |
|
|
|
|
case 'MYSQL': |
|
|
|
|
this.sourceMysqlParams = JSON.parse(data) |
|
|
|
|
this.srcDatasource = this.sourceMysqlParams.srcDatasource |
|
|
|
|
break; |
|
|
|
|
case "ORACLE": |
|
|
|
|
break |
|
|
|
|
case 'ORACLE': |
|
|
|
|
this.sourceOracleParams = JSON.parse(data) |
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
this.sourceHdfsParams = JSON.parse(data) |
|
|
|
|
break; |
|
|
|
|
case "HIVE": |
|
|
|
|
break |
|
|
|
|
case 'HIVE': |
|
|
|
|
this.sourceHiveParams = JSON.parse(data) |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -928,22 +928,21 @@
|
|
|
|
|
*/ |
|
|
|
|
_getTargetParams (data) { |
|
|
|
|
switch (this.targetType) { |
|
|
|
|
case "HIVE": |
|
|
|
|
case 'HIVE': |
|
|
|
|
this.targetHiveParams = JSON.parse(data) |
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
this.targetHdfsParams = JSON.parse(data) |
|
|
|
|
break; |
|
|
|
|
case "MYSQL": |
|
|
|
|
break |
|
|
|
|
case 'MYSQL': |
|
|
|
|
this.targetMysqlParams = JSON.parse(data) |
|
|
|
|
this.targetDatasource = this.targetMysqlParams.targetDatasource |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* verification |
|
|
|
|
*/ |
|
|
|
@ -957,7 +956,7 @@
|
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
sqoopParams['customShell'] = shellEditor.getValue() |
|
|
|
|
sqoopParams.customShell = shellEditor.getValue() |
|
|
|
|
} else { |
|
|
|
|
if (!this.jobName) { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`) |
|
|
|
@ -965,7 +964,7 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (this.sourceType) { |
|
|
|
|
case "MYSQL": |
|
|
|
|
case 'MYSQL': |
|
|
|
|
if (!this.$refs.refSourceDs._verifDatasource()) { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
@ -974,84 +973,84 @@
|
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
this.sourceMysqlParams.srcTable = "" |
|
|
|
|
this.sourceMysqlParams.srcColumnType = "0" |
|
|
|
|
this.sourceMysqlParams.srcColumns = "" |
|
|
|
|
this.sourceMysqlParams.srcTable = '' |
|
|
|
|
this.sourceMysqlParams.srcColumnType = '0' |
|
|
|
|
this.sourceMysqlParams.srcColumns = '' |
|
|
|
|
} else { |
|
|
|
|
if (this.sourceMysqlParams.srcTable === "") { |
|
|
|
|
if (this.sourceMysqlParams.srcTable === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
this.sourceMysqlParams.srcQuerySql = "" |
|
|
|
|
if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { |
|
|
|
|
this.sourceMysqlParams.srcQuerySql = '' |
|
|
|
|
if (this.sourceMysqlParams.srcColumnType === '1' && this.sourceMysqlParams.srcColumns === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.sourceMysqlParams.srcColumnType === "0") { |
|
|
|
|
this.sourceMysqlParams.srcColumns = "" |
|
|
|
|
if (this.sourceMysqlParams.srcColumnType === '0') { |
|
|
|
|
this.sourceMysqlParams.srcColumns = '' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
if (this.sourceHdfsParams.exportDir === "") { |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
if (this.sourceHdfsParams.exportDir === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Export Dir(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "HIVE": |
|
|
|
|
if (this.sourceHiveParams.hiveDatabase === "") { |
|
|
|
|
break |
|
|
|
|
case 'HIVE': |
|
|
|
|
if (this.sourceHiveParams.hiveDatabase === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.sourceHiveParams.hiveTable === "") { |
|
|
|
|
if (this.sourceHiveParams.hiveTable === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch (this.targetType) { |
|
|
|
|
case "HIVE": |
|
|
|
|
if (this.targetHiveParams.hiveDatabase === "") { |
|
|
|
|
case 'HIVE': |
|
|
|
|
if (this.targetHiveParams.hiveDatabase === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
if (this.targetHiveParams.hiveTable === "") { |
|
|
|
|
if (this.targetHiveParams.hiveTable === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "HDFS": |
|
|
|
|
if (this.targetHdfsParams.targetPath === "") { |
|
|
|
|
break |
|
|
|
|
case 'HDFS': |
|
|
|
|
if (this.targetHdfsParams.targetPath === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Target Dir(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case "MYSQL": |
|
|
|
|
break |
|
|
|
|
case 'MYSQL': |
|
|
|
|
if (!this.$refs.refTargetDs._verifDatasource()) { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (this.targetMysqlParams.targetTable === "") { |
|
|
|
|
if (this.targetMysqlParams.targetTable === '') { |
|
|
|
|
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
sqoopParams['jobName'] = this.jobName |
|
|
|
|
sqoopParams['hadoopCustomParams'] = this.hadoopCustomParams |
|
|
|
|
sqoopParams['sqoopAdvancedParams'] = this.sqoopAdvancedParams |
|
|
|
|
sqoopParams['concurrency'] = this.concurrency |
|
|
|
|
sqoopParams['modelType'] = this.modelType |
|
|
|
|
sqoopParams['sourceType'] = this.sourceType |
|
|
|
|
sqoopParams['targetType'] = this.targetType |
|
|
|
|
sqoopParams['targetParams'] = this._handleTargetParams() |
|
|
|
|
sqoopParams['sourceParams'] = this._handleSourceParams() |
|
|
|
|
sqoopParams.jobName = this.jobName |
|
|
|
|
sqoopParams.hadoopCustomParams = this.hadoopCustomParams |
|
|
|
|
sqoopParams.sqoopAdvancedParams = this.sqoopAdvancedParams |
|
|
|
|
sqoopParams.concurrency = this.concurrency |
|
|
|
|
sqoopParams.modelType = this.modelType |
|
|
|
|
sqoopParams.sourceType = this.sourceType |
|
|
|
|
sqoopParams.targetType = this.targetType |
|
|
|
|
sqoopParams.targetParams = this._handleTargetParams() |
|
|
|
|
sqoopParams.sourceParams = this._handleSourceParams() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// storage |
|
|
|
@ -1149,7 +1148,7 @@
|
|
|
|
|
sourceParams: this._handleSourceParams(), |
|
|
|
|
targetParams: this._handleTargetParams(), |
|
|
|
|
localParams: this.localParams |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_destroyEditor () { |
|
|
|
@ -1276,4 +1275,3 @@
|
|
|
|
|
top: -16px; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|
|
|
|
|