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 2022/08/26 11:26:21 UTC

[GitHub] [dolphinscheduler] fengjian1129 opened a new pull request, #11667: [Improvement-11608][task-plugin] #11608 New time variables are added to facilitate business development,and add docs

fengjian1129 opened a new pull request, #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667

   <!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
   
   
   ## Purpose of the pull request
   
   <!--(For example: This pull request adds checkstyle plugin).-->
   
   ## Brief change log
   
   <!--*(for example:)*
     - *Add maven-checkstyle-plugin to root pom.xml*
   -->
   ## Verify this pull request
   
   <!--*(Please pick either of the following options)*-->
   
   This pull request is code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   <!--*(example:)*
     - *Added dolphinscheduler-dao tests for end-to-end.*
     - *Added CronUtilsTest to verify the change.*
     - *Manually verified the change by testing locally.* -->
   
   (or)
   
   If your pull request contain incompatible change, you should also add it to `docs/docs/en/guide/upgrede/incompatible.md`
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 merged pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 merged PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1257554496

   > > I've restarted failed jobs in CI, LGTM once CI passes.
   > 
   > What do u want me to do ?
   
   Nothing actually, just wait for the CI to complete. It seems CI is not very stable recently.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1254984481

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1255771971

   @ruanwenjun @caishunfeng @SbloodyS Could u plz help take a look when available? Thanks : )


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1256992803

   @EricGao888 @davidzollo thanks bro


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1235126126

   @ruanwenjun hi bro. can you review the code I submitted.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1257556569

   > Nothing actually, just wait for the CI to complete. It seems CI is not very stable recently.
   
   okay, i see. Thanks


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] ruanwenjun commented on pull request #11667: [Improvement-11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
ruanwenjun commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1229454167

   @fengjian1129 Please create an issue first, why we need to do this change.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1254896601

   @EricGao888 Code has been updated


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] #11608 New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1229674821

   @ruanwenjun hi bro,i have created a issue,link:https://github.com/apache/dolphinscheduler/issues/11608
   The purpose of adding the time variable is to provide the common business time in the production environment, which will be convenient to use. The original time variable needs multiple calculations. Moreover, in the production environment, the time variables used for business development need to be configured simply and quickly


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1253640838

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1257550864

   > I've restarted failed jobs in CI, LGTM once CI passes.
   
   What do u want me to do ? 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#discussion_r977507284


##########
docs/docs/zh/guide/parameter/built-in.md:
##########
@@ -28,23 +28,33 @@
 - 我们定义这种基准变量为 \$[...] 格式的,\$[yyyyMMddHHmmss] 是可以任意分解组合的,比如:\$[yyyyMMdd], \$[HHmmss], \$[yyyy-MM-dd] 等
 
 - 也可以通过以下两种方式:
-
-  1.使用add_months()函数,该函数用于加减月份,
-  第一个入口参数为[yyyyMMdd],表示返回时间的格式
-  第二个入口参数为月份偏移量,表示加减多少个月
-  * 后 N 年:$[add_months(yyyyMMdd,12*N)]
-  * 前 N 年:$[add_months(yyyyMMdd,-12*N)]
-  * 后 N 月:$[add_months(yyyyMMdd,N)]
-  * 前 N 月:$[add_months(yyyyMMdd,-N)]
-  *******************************************
-  2.直接加减数字
-  在自定义格式后直接“+/-”数字
-  * 后 N 周:$[yyyyMMdd+7*N]
-  * 前 N 周:$[yyyyMMdd-7*N]
-  * 后 N 天:$[yyyyMMdd+N]
-  * 前 N 天:$[yyyyMMdd-N]
-  * 后 N 小时:$[HHmmss+N/24]
-  * 前 N 小时:$[HHmmss-N/24]
-  * 后 N 分钟:$[HHmmss+N/24/60]
-  * 前 N 分钟:$[HHmmss-N/24/60]
-
+    1.使用add_months()函数,该函数用于加减月份,
+    第一个入口参数为[yyyyMMdd],表示返回时间的格式
+    第二个入口参数为月份偏移量,表示加减多少个月

Review Comment:
   > BTW, I think there could be a better design. Instead of using `N` and converting it into different time units, I suggest we use `y` for year, `M` or month, `d` for day. For example, replace `$[add_months(yyyyMMdd,12*N)]` with `$[add(yyyyMMdd, y)]`. But this is out of the scope of this PR. I will create a new issue for further discussion.
   
   +1



##########
docs/docs/zh/guide/parameter/built-in.md:
##########
@@ -28,23 +28,33 @@
 - 我们定义这种基准变量为 \$[...] 格式的,\$[yyyyMMddHHmmss] 是可以任意分解组合的,比如:\$[yyyyMMdd], \$[HHmmss], \$[yyyy-MM-dd] 等
 
 - 也可以通过以下两种方式:
-
-  1.使用add_months()函数,该函数用于加减月份,
-  第一个入口参数为[yyyyMMdd],表示返回时间的格式
-  第二个入口参数为月份偏移量,表示加减多少个月
-  * 后 N 年:$[add_months(yyyyMMdd,12*N)]
-  * 前 N 年:$[add_months(yyyyMMdd,-12*N)]
-  * 后 N 月:$[add_months(yyyyMMdd,N)]
-  * 前 N 月:$[add_months(yyyyMMdd,-N)]
-  *******************************************
-  2.直接加减数字
-  在自定义格式后直接“+/-”数字
-  * 后 N 周:$[yyyyMMdd+7*N]
-  * 前 N 周:$[yyyyMMdd-7*N]
-  * 后 N 天:$[yyyyMMdd+N]
-  * 前 N 天:$[yyyyMMdd-N]
-  * 后 N 小时:$[HHmmss+N/24]
-  * 前 N 小时:$[HHmmss-N/24]
-  * 后 N 分钟:$[HHmmss+N/24/60]
-  * 前 N 分钟:$[HHmmss-N/24/60]
-
+    1.使用add_months()函数,该函数用于加减月份,
+    第一个入口参数为[yyyyMMdd],表示返回时间的格式
+    第二个入口参数为月份偏移量,表示加减多少个月

Review Comment:
   > If my PR is merged, I will consider adding this design to the next PR. However, for business development, people prefer to use independent time expressions rather than one formula to produce multiple time expressions. In other words, I want to calculate the month. I only use addmonth (); I want to calculate the year. I only use addyear () and so on
   
   +1



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-11608][task-plugin] #11608 New time variables are added to facilitate business development,and add docs

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1228614711

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1244819166

   @caishunfeng @zhongjiajie @zhuangchong hello , Can I submit this PR to the community?


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-11608][task-plugin] #11608 New time variables are added to facilitate business development,and add docs

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1228611108

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1235126786

   @EricGao888 look this pr


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on code in PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#discussion_r977442133


##########
docs/docs/zh/guide/parameter/built-in.md:
##########
@@ -28,23 +28,33 @@
 - 我们定义这种基准变量为 \$[...] 格式的,\$[yyyyMMddHHmmss] 是可以任意分解组合的,比如:\$[yyyyMMdd], \$[HHmmss], \$[yyyy-MM-dd] 等
 
 - 也可以通过以下两种方式:
-
-  1.使用add_months()函数,该函数用于加减月份,
-  第一个入口参数为[yyyyMMdd],表示返回时间的格式
-  第二个入口参数为月份偏移量,表示加减多少个月
-  * 后 N 年:$[add_months(yyyyMMdd,12*N)]
-  * 前 N 年:$[add_months(yyyyMMdd,-12*N)]
-  * 后 N 月:$[add_months(yyyyMMdd,N)]
-  * 前 N 月:$[add_months(yyyyMMdd,-N)]
-  *******************************************
-  2.直接加减数字
-  在自定义格式后直接“+/-”数字
-  * 后 N 周:$[yyyyMMdd+7*N]
-  * 前 N 周:$[yyyyMMdd-7*N]
-  * 后 N 天:$[yyyyMMdd+N]
-  * 前 N 天:$[yyyyMMdd-N]
-  * 后 N 小时:$[HHmmss+N/24]
-  * 前 N 小时:$[HHmmss-N/24]
-  * 后 N 分钟:$[HHmmss+N/24/60]
-  * 前 N 分钟:$[HHmmss-N/24/60]
-
+    1.使用add_months()函数,该函数用于加减月份,

Review Comment:
   Could u plz add a corresponding English doc for this feature?



##########
docs/docs/zh/guide/parameter/built-in.md:
##########
@@ -28,23 +28,33 @@
 - 我们定义这种基准变量为 \$[...] 格式的,\$[yyyyMMddHHmmss] 是可以任意分解组合的,比如:\$[yyyyMMdd], \$[HHmmss], \$[yyyy-MM-dd] 等
 
 - 也可以通过以下两种方式:
-
-  1.使用add_months()函数,该函数用于加减月份,
-  第一个入口参数为[yyyyMMdd],表示返回时间的格式
-  第二个入口参数为月份偏移量,表示加减多少个月
-  * 后 N 年:$[add_months(yyyyMMdd,12*N)]
-  * 前 N 年:$[add_months(yyyyMMdd,-12*N)]
-  * 后 N 月:$[add_months(yyyyMMdd,N)]
-  * 前 N 月:$[add_months(yyyyMMdd,-N)]
-  *******************************************
-  2.直接加减数字
-  在自定义格式后直接“+/-”数字
-  * 后 N 周:$[yyyyMMdd+7*N]
-  * 前 N 周:$[yyyyMMdd-7*N]
-  * 后 N 天:$[yyyyMMdd+N]
-  * 前 N 天:$[yyyyMMdd-N]
-  * 后 N 小时:$[HHmmss+N/24]
-  * 前 N 小时:$[HHmmss-N/24]
-  * 后 N 分钟:$[HHmmss+N/24/60]
-  * 前 N 分钟:$[HHmmss-N/24/60]
-
+    1.使用add_months()函数,该函数用于加减月份,
+    第一个入口参数为[yyyyMMdd],表示返回时间的格式
+    第二个入口参数为月份偏移量,表示加减多少个月

Review Comment:
   BTW, I think there could be a better design. Instead of using `N` and converting it into different time units, I suggest we use `y` for year, `M` or month, `d` for day. For example, replace `$[add_months(yyyyMMdd,12*N)]` with `$[add(yyyyMMdd, y)]`. But this is out of the scope of this PR. I will create a new issue for further discussion.



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/TimePlaceholderUtils.java:
##########
@@ -363,6 +375,92 @@ private static String calculateTime(String expression, Date date) {
         return value;
     }
 
+    /**
+     * get week of year
+     * @param expression expression
+     * @param date       date
+     * @return week of year
+     */
+    public static String calcYearWeek(String expression, Date date) {

Review Comment:
   ```suggestion
       public static String calculateYearWeek(String expression, Date date) {
   ```
   
   `calc` is a wired shorthand. I prefer to use `calculate` here.



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parser/TimePlaceholderUtils.java:
##########
@@ -363,6 +375,92 @@ private static String calculateTime(String expression, Date date) {
         return value;
     }
 
+    /**
+     * get week of year
+     * @param expression expression
+     * @param date       date
+     * @return week of year
+     */
+    public static String calcYearWeek(String expression, Date date) {
+
+        String dataFormat = expression.substring(YEAR_WEEK.length() + 1, expression.length() - 1);
+
+        String targetDate = "";
+        try {
+
+            if(dataFormat.contains(COMMA)) {
+                String param1 = dataFormat.split(COMMA)[0];
+                String param2 = dataFormat.split(COMMA)[1];
+                dataFormat = param1;
+
+                targetDate = transformYearWeek(date, dataFormat, calculate(param2));
+
+            } else {
+                targetDate = transformYearWeek(date, dataFormat, 1);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("expression not valid");
+        }
+
+        return targetDate;
+    }
+
+    /**
+     * transform week of year
+     * @param date date
+     * @param format date_format,for example: yyyy-MM-dd / yyyyMMdd
+     * @param weekDay day of week
+     * @return date_string
+     */
+    private static String transformYearWeek(Date date,String format,int weekDay) {

Review Comment:
   ```suggestion
       private static String transformYearWeek(Date date, String format, int weekDay) {
   ```



##########
dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/test/java/org/apache/dolphinscheduler/plugin/task/api/parser/TimePlaceholderUtilsTest.java:
##########
@@ -0,0 +1,118 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.task.api.parser;
+
+import org.apache.dolphinscheduler.spi.enums.CommandType;
+import org.apache.dolphinscheduler.spi.utils.DateUtils;
+
+import java.util.Date;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+
+public class TimePlaceholderUtilsTest {
+
+    @Test
+    public void placeHolderTimeTest() {
+        Date date = DateUtils.parse("2022-08-26 00:00:00", "yyyy-MM-dd HH:mm:ss");
+
+        Map<String, String> timeParams = BusinessTimeUtils.getBusinessTime(CommandType.COMPLEMENT_DATA, date);
+
+        // this_day test

Review Comment:
   Instead of writing a long method as a test case, I suggest splitting it into multiple short cases and remove the comments. For example, we could have 
   
   ```java
   @Test
       public void timePlaceHolderForThisDay () { ... }
   ```
   
   here.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] EricGao888 commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
EricGao888 commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1257648725

   @fengjian1129 Good job! This is a handy feature, thanks again for the contribution! 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #11667: [Improvement-11608][task-plugin] #11608 New time variables are added to facilitate business development,and add docs

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1228389547

   # [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/11667?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11667](https://codecov.io/gh/apache/dolphinscheduler/pull/11667?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cd4a7a4) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/cccbd27c589d84bc5238aaad5b15c18c4c10ba41?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cccbd27) will **decrease** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   > :exclamation: Current head cd4a7a4 differs from pull request most recent head 96afd4f. Consider uploading reports for the commit 96afd4f to get more accurate results
   
   ```diff
   @@             Coverage Diff              @@
   ##                dev   #11667      +/-   ##
   ============================================
   - Coverage     39.81%   39.80%   -0.01%     
   + Complexity     4718     4716       -2     
   ============================================
     Files          1002     1002              
     Lines         37872    37854      -18     
     Branches       4230     4222       -8     
   ============================================
   - Hits          15079    15069      -10     
   + Misses        21192    21183       -9     
   - Partials       1601     1602       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/11667?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...erver/master/processor/queue/TaskEventService.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9wcm9jZXNzb3IvcXVldWUvVGFza0V2ZW50U2VydmljZS5qYXZh) | `75.00% <0.00%> (-5.36%)` | :arrow_down: |
   | [...e/dolphinscheduler/remote/NettyRemotingClient.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1yZW1vdGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcmVtb3RlL05ldHR5UmVtb3RpbmdDbGllbnQuamF2YQ==) | `50.00% <0.00%> (-2.78%)` | :arrow_down: |
   | [...rver/master/runner/task/BlockingTaskProcessor.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9ydW5uZXIvdGFzay9CbG9ja2luZ1Rhc2tQcm9jZXNzb3IuamF2YQ==) | `75.86% <0.00%> (-0.55%)` | :arrow_down: |
   | [...eduler/api/service/impl/DataSourceServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9EYXRhU291cmNlU2VydmljZUltcGwuamF2YQ==) | `27.90% <0.00%> (ø)` | |
   | [...cheduler/server/master/utils/DependentExecute.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci91dGlscy9EZXBlbmRlbnRFeGVjdXRlLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../dolphinscheduler/plugin/task/datax/DataxTask.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stZGF0YXgvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvcGx1Z2luL3Rhc2svZGF0YXgvRGF0YXhUYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...phinscheduler/plugin/task/chunjun/ChunJunTask.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stY2h1bmp1bi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZG9scGhpbnNjaGVkdWxlci9wbHVnaW4vdGFzay9jaHVuanVuL0NodW5KdW5UYXNrLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...cheduler/plugin/task/api/ShellCommandExecutor.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci10YXNrLXBsdWdpbi9kb2xwaGluc2NoZWR1bGVyLXRhc2stYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3BsdWdpbi90YXNrL2FwaS9TaGVsbENvbW1hbmRFeGVjdXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...nscheduler/service/process/ProcessServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1zZXJ2aWNlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kb2xwaGluc2NoZWR1bGVyL3NlcnZpY2UvcHJvY2Vzcy9Qcm9jZXNzU2VydmljZUltcGwuamF2YQ==) | `31.80% <0.00%> (+0.02%)` | :arrow_up: |
   | [...server/master/runner/task/SwitchTaskProcessor.java](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9ydW5uZXIvdGFzay9Td2l0Y2hUYXNrUHJvY2Vzc29yLmphdmE=) | `2.54% <0.00%> (+0.02%)` | :arrow_up: |
   | ... and [5 more](https://codecov.io/gh/apache/dolphinscheduler/pull/11667/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1253640313

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] fengjian1129 commented on a diff in pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
fengjian1129 commented on code in PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#discussion_r977478508


##########
docs/docs/zh/guide/parameter/built-in.md:
##########
@@ -28,23 +28,33 @@
 - 我们定义这种基准变量为 \$[...] 格式的,\$[yyyyMMddHHmmss] 是可以任意分解组合的,比如:\$[yyyyMMdd], \$[HHmmss], \$[yyyy-MM-dd] 等
 
 - 也可以通过以下两种方式:
-
-  1.使用add_months()函数,该函数用于加减月份,
-  第一个入口参数为[yyyyMMdd],表示返回时间的格式
-  第二个入口参数为月份偏移量,表示加减多少个月
-  * 后 N 年:$[add_months(yyyyMMdd,12*N)]
-  * 前 N 年:$[add_months(yyyyMMdd,-12*N)]
-  * 后 N 月:$[add_months(yyyyMMdd,N)]
-  * 前 N 月:$[add_months(yyyyMMdd,-N)]
-  *******************************************
-  2.直接加减数字
-  在自定义格式后直接“+/-”数字
-  * 后 N 周:$[yyyyMMdd+7*N]
-  * 前 N 周:$[yyyyMMdd-7*N]
-  * 后 N 天:$[yyyyMMdd+N]
-  * 前 N 天:$[yyyyMMdd-N]
-  * 后 N 小时:$[HHmmss+N/24]
-  * 前 N 小时:$[HHmmss-N/24]
-  * 后 N 分钟:$[HHmmss+N/24/60]
-  * 前 N 分钟:$[HHmmss-N/24/60]
-
+    1.使用add_months()函数,该函数用于加减月份,
+    第一个入口参数为[yyyyMMdd],表示返回时间的格式
+    第二个入口参数为月份偏移量,表示加减多少个月

Review Comment:
   If my PR is merged, I will consider adding this design to the next PR. However, for business development, people prefer to use independent time expressions rather than one formula to produce multiple time expressions. In other words, I want to calculate the month. I only use addmonth (); I want to calculate the year. I only use addyear () and so on



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #11667: [Improvement-#11608][task-plugin] New time variables are added to facilitate business development

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #11667:
URL: https://github.com/apache/dolphinscheduler/pull/11667#issuecomment-1254976552

   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=11667)
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL) [17 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=11667&resolved=false&types=CODE_SMELL)
   
   [![74.7%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '74.7%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list) [74.7% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_coverage&view=list)  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=11667&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.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org