gary0416 opened a new pull request #913: [Enhancement] params support 
cross-reference etc.
URL: https://github.com/apache/incubator-dolphinscheduler/pull/913
 
 
   1. Complements are more friendly:
   
   Before modification: The formatting defaults to the current time. If 
system.datetime is defined, the parameters are directly parsed in yyyMMddHmmss 
format (without passing custom parameters).
   
   After modification: the parameter ${system.datetime}= ${system.biz.date} 
0000000 can be defined, so that when the program obtains formatting time (e.g. 
$[MMdd]), whether the complement or normal operation, the results are 
consistent with expectations.
   
   2. Parameters support cross-reference
   
   Use scenario: Hive loads partition SQL, location needs'/path/2019/09/27'.
   
   Before modification: LOCATION ${hdfs.path}/$[yyyy]/$[MM]/$[dd] is parsed 
into LOCATION'/path'/'2019'/'09'/'27'(INT type will become 9, missing 0) 
according to JDBC parameters.
   
   After modification: defining parameters param.yyyy=$[yyyyy], param.MM=$[MM], 
param.dd=$[dd], final.path=${hdfs.path}/${param.yyyy}/${param.MM}/${param.dd}. 
SQL: LOCATION ${final.path} will be resolved to the correct: location 
'/path/2019/09/27'.
   
   ***
   
   1.补数更加友好:
   
   修改前:格式化默认按当前时间,如果定义了system.datetime,则按yyyyMMddHHmmss格式直接解析参数值(无法带参数)。
   
修改后:可以定义参数${system.datetime}=${system.biz.date}0000000,这样程序获取格式化时间时(例如$[MMdd]),无论是补数还是正常运行,结果均与预期相符。
   
   2.参数支持互相引用
   
   使用场景:Hive加载分区SQL,location需要'/path/2019/09/27'。
   
   修改前:LOCATION ${hdfs.path}/$[yyyy]/$[MM]/$[dd]按照JDBC参数被解析成LOCATION 
'/path'/'2019'/'09'/'27'(INT类型会变成9,缺少0)
   
修改后:定义参数param.yyyy=$[yyyy],param.MM=$[MM],param.dd=$[dd],final.path=${hdfs.path}/${param.yyyy}/${param.MM}/${param.dd}.SQL写LOCATION
 ${final.path},会被解析成正确的location '/path/2019/09/27'.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to