You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/03/18 09:18:29 UTC
[GitHub] [incubator-dolphinscheduler] simon824 opened a new pull request
#2224: support custom datax configuration
simon824 opened a new pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224
support custom datax configuration #2102
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on issue
#2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600934460
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/40.png' alt='42.1%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list) [42.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in
pull request #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#discussion_r394743049
##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
##########
@@ -192,24 +192,47 @@ private String buildDataxJsonFile()
throws Exception {
// generate json
String fileName = String.format("%s/%s_job.json", taskDir, taskProps.getTaskAppId());
+ String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
- JSONObject job = new JSONObject();
- job.put("content", buildDataxJobContentJson());
- job.put("setting", buildDataxJobSettingJson());
- JSONObject root = new JSONObject();
- root.put("job", job);
- root.put("core", buildDataxCoreJson());
- logger.debug("datax job json : {}", root.toString());
+ if (dataXParameters.getCustomConfig() == 1){
+
+ json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
+
Review comment:
> here is about custom variables
Sorry, I didn't see it. it's my fault.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in
pull request #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#discussion_r394733232
##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
##########
@@ -192,24 +192,47 @@ private String buildDataxJsonFile()
throws Exception {
// generate json
String fileName = String.format("%s/%s_job.json", taskDir, taskProps.getTaskAppId());
+ String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
- JSONObject job = new JSONObject();
- job.put("content", buildDataxJobContentJson());
- job.put("setting", buildDataxJobSettingJson());
- JSONObject root = new JSONObject();
- root.put("job", job);
- root.put("core", buildDataxCoreJson());
- logger.debug("datax job json : {}", root.toString());
+ if (dataXParameters.getCustomConfig() == 1){
+
+ json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
+
Review comment:
Variables can also be used in datax job json, which will cause json to be invalid, such as
```
{
...
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "${db_user}",
"password": "${db_pwd}",
"encoding": "UTF-8",
"column": [${tbl_clms}],
"connection": [
{
"jdbcUrl": [
"jdbc:mysql://${host}/${db}?useUnicode=true&characterEncoding=utf8"
],
"table": [
${table_list}
]
}
]
}
}
...
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] simon824 commented on a change in pull
request #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
simon824 commented on a change in pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#discussion_r394736584
##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
##########
@@ -192,24 +192,47 @@ private String buildDataxJsonFile()
throws Exception {
// generate json
String fileName = String.format("%s/%s_job.json", taskDir, taskProps.getTaskAppId());
+ String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
- JSONObject job = new JSONObject();
- job.put("content", buildDataxJobContentJson());
- job.put("setting", buildDataxJobSettingJson());
- JSONObject root = new JSONObject();
- root.put("job", job);
- root.put("core", buildDataxCoreJson());
- logger.debug("datax job json : {}", root.toString());
+ if (dataXParameters.getCustomConfig() == 1){
+
+ json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
+
Review comment:
here is about custom variables
![image](https://user-images.githubusercontent.com/18065113/77021783-afaace00-69c2-11ea-9db7-db09767daee7.png)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] removed a comment on
issue #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600597517
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/40.png' alt='42.1%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list) [42.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] removed a comment on
issue #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600533248
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/40.png' alt='42.1%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list) [42.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] codecov-io commented on issue #2224:
support custom datax configuration
Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600595896
# [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=h1) Report
> Merging [#2224](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=desc) into [dev](https://codecov.io/gh/apache/incubator-dolphinscheduler/commit/0e5fb86bef1f62c64159aedd9ae1c5e361669fb0?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `58.06%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/graphs/tree.svg?width=650&token=bv9iXXRLi9&height=150&src=pr)](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## dev #2224 +/- ##
============================================
+ Coverage 29.71% 29.75% +0.03%
- Complexity 1629 1630 +1
============================================
Files 336 336
Lines 17807 17807
Branches 2238 2238
============================================
+ Hits 5291 5298 +7
+ Misses 11964 11959 -5
+ Partials 552 550 -2
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...inscheduler/common/task/datax/DataxParameters.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3Rhc2svZGF0YXgvRGF0YXhQYXJhbWV0ZXJzLmphdmE=) | `0% <0%> (ø)` | `0 <0> (ø)` | :arrow_down: |
| [...nscheduler/server/worker/task/datax/DataxTask.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL2RhdGF4L0RhdGF4VGFzay5qYXZh) | `74.64% <94.73%> (ø)` | `19 <0> (ø)` | :arrow_down: |
| [...scheduler/alert/template/AlertTemplateFactory.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1hbGVydC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9hbGVydC90ZW1wbGF0ZS9BbGVydFRlbXBsYXRlRmFjdG9yeS5qYXZh) | `42.85% <0%> (ø)` | `2% <0%> (ø)` | :arrow_down: |
| [...nscheduler/server/worker/task/shell/ShellTask.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL3NoZWxsL1NoZWxsVGFzay5qYXZh) | `72.91% <0%> (+2.08%)` | `5% <0%> (ø)` | :arrow_down: |
| [...er/server/worker/task/AbstractCommandExecutor.java](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224/diff?src=pr&el=tree#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL3dvcmtlci90YXNrL0Fic3RyYWN0Q29tbWFuZEV4ZWN1dG9yLmphdmE=) | `39.53% <0%> (+2.79%)` | `15% <0%> (+1%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=footer). Last update [0e5fb86...28f2c84](https://codecov.io/gh/apache/incubator-dolphinscheduler/pull/2224?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in
pull request #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#discussion_r394732440
##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
##########
@@ -192,24 +192,47 @@ private String buildDataxJsonFile()
throws Exception {
// generate json
String fileName = String.format("%s/%s_job.json", taskDir, taskProps.getTaskAppId());
+ String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
- JSONObject job = new JSONObject();
- job.put("content", buildDataxJobContentJson());
- job.put("setting", buildDataxJobSettingJson());
- JSONObject root = new JSONObject();
- root.put("job", job);
- root.put("core", buildDataxCoreJson());
- logger.debug("datax job json : {}", root.toString());
+ if (dataXParameters.getCustomConfig() == 1){
+
+ json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
+
+ /**
+ * combining local and global parameters
+ */
+ Map<String, Property> paramsMap = ParamUtils.convert(taskProps.getUserDefParamsMap(),
+ taskProps.getDefinedParams(),
+ dataXParameters.getLocalParametersMap(),
+ taskProps.getCmdTypeIfComplement(),
+ taskProps.getScheduleTime());
+ if (paramsMap != null){
+ json = ParameterUtils.convertParameterPlaceholders(json, ParamUtils.convert(paramsMap));
+ }
+
+ }else {
+
+ JSONObject job = new JSONObject();
+ job.put("content", buildDataxJobContentJson());
+ job.put("setting", buildDataxJobSettingJson());
+
+ JSONObject root = new JSONObject();
+ root.put("job", job);
+ root.put("core", buildDataxCoreJson());
+ json = root.toString();
+ }
+
+ logger.debug("datax job json : {}", json);
Review comment:
I think logger.info would be easy to debug the whole task.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] Jave-Chen commented on a change in
pull request #2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
Jave-Chen commented on a change in pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#discussion_r394743049
##########
File path: dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/worker/task/datax/DataxTask.java
##########
@@ -192,24 +192,47 @@ private String buildDataxJsonFile()
throws Exception {
// generate json
String fileName = String.format("%s/%s_job.json", taskDir, taskProps.getTaskAppId());
+ String json;
Path path = new File(fileName).toPath();
if (Files.exists(path)) {
return fileName;
}
- JSONObject job = new JSONObject();
- job.put("content", buildDataxJobContentJson());
- job.put("setting", buildDataxJobSettingJson());
- JSONObject root = new JSONObject();
- root.put("job", job);
- root.put("core", buildDataxCoreJson());
- logger.debug("datax job json : {}", root.toString());
+ if (dataXParameters.getCustomConfig() == 1){
+
+ json = dataXParameters.getJson().replaceAll("\\r\\n", "\n");
+
Review comment:
> here is about custom variables
Sorry, I didn't see it. it's my fault.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on issue
#2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600533248
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/40.png' alt='42.1%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list) [42.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] dailidong merged pull request #2224:
support custom datax configuration
Posted by GitBox <gi...@apache.org>.
dailidong merged pull request #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [incubator-dolphinscheduler] sonarcloud[bot] commented on issue
#2224: support custom datax configuration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on issue #2224: support custom datax configuration
URL: https://github.com/apache/incubator-dolphinscheduler/pull/2224#issuecomment-600597517
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=2224&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/40.png' alt='42.1%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list) [42.1% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=2224&metric=new_duplicated_lines_density&view=list)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services