You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@linkis.apache.org by rita <ri...@163.com> on 2022/08/09 02:51:09 UTC
[DISCUSS]Time Operation Variable
Dear:
The chat records of WeChat group“Apache linkis Community Development Group”are as follows微信群"Apache Linkis 社区开发群"的聊天记录如下
————— 2022-8-3 —————
peacewong@WDS 15:00
@Test def testVar(): Unit = {
val code = """seasons = ['Spring', 'Summer', 'Fall', 'Winter']
|list(enumerate(seasons))
|print(seasons)
|print('${a1}')
|print(${a2})
|""".stripMargin
println(VariableUtils.replace(code))
}
peacewong@WDS 15:01
peacewong@WDS 15:01
@duhanmin The variables related to this time operation will be resolved by A @ 野鹿 函敏兄 这个时间操作相关的变量,看会解析a这种
peacewong@WDS 15:01
It will translate to AM or AM会解析成上午或者AM
@duhanmin野鹿 15:02
@duhanmin野鹿 15:02
It feels like a conflict感觉会有点冲突
peacewong@WDS 15:03
yes ,evaluate whether to make someregulations是的,看是不是做些规范
peacewong@WDS 15:06
This is a little bit tricky to deal with, the A/H /s thing alone这个确实有点难处理,单独的a/h/s这种
peacewong@WDS 15:07
There are also problems with strings made up of the characters above还有就是用这上面的字符组成的字符串也会有问题
peacewong@WDS 15:08
print('${ahs}' This form of custom variable, for example, may be replaced by a time parameter variable比如这种自定义变量的形式,可能就会被时间参数变量替换了
@duhanmin野鹿 15:09
Custom variables take precedence, global variables take precedence, as long as there is no ${}自定义变量优先替换,全局变量优先级低, 只要没有${}就没问题
peacewong@WDS 15:09
Priorities need to be changed 感觉优先级得改下
peacewong@WDS 15:09
peacewong@WDS 15:09
yeah, we need to prioritize是的,优先级得优化下
@duhanmin野鹿 15:10
Ok
@duhanmin野鹿 15:28
In this case, Python,spark,and flink all have a value like${} by column,in this case, we change the format of this global variable to be similar to ${}$这种情况python/spark/flink 都有类似${}按列去值, 这种情况,我们把这种全局变量换一下格式,类似${}$
@duhanmin野鹿 15:28
There will be no confict with the original code syntax.就不会和原有代码语法冲突
peacewong@WDS 15:29
this kind of time manipulation variable 这种时间操作变量是吧
@duhanmin野鹿 15:29
yes是的
@duhanmin野鹿 15:29
Or use${{}}或者采用${{}}
peacewong@WDS 15:29
I think so define a new specification that might affect theoriginal substitution ofvariables我觉得也可以的,定义一种新的规范可能对原有的变量替换影响野小点
@duhanmin野鹿 15:30
YES, # is better可以,#比较好